[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 60/473: Minor optimization of search algorithm.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:53:50 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 3a694902793b5e4ccabe1c9683967056fccb02b0
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Jul 3 10:50:11 2013 -0400

    Minor optimization of search algorithm.
---
 src/launcher.cpp |   10 ----------
 src/launcher.hpp |   10 +++++++---
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/launcher.cpp b/src/launcher.cpp
index 0483a04..7f8ec5b 100644
--- a/src/launcher.cpp
+++ b/src/launcher.cpp
@@ -16,8 +16,6 @@
 
 #include "launcher.hpp"
 
-#include "query.hpp"
-
 extern "C"
 {
 #include <exo/exo.h>
@@ -174,14 +172,6 @@ Launcher::~Launcher()
 
 //-----------------------------------------------------------------------------
 
-unsigned int Launcher::get_search_results(const Query &query) const
-{
-	std::map<std::string, unsigned int>::const_iterator i = m_searches.find(query.query());
-	return (i != m_searches.end()) ? i->second : UINT_MAX;
-}
-
-//-----------------------------------------------------------------------------
-
 void Launcher::run(GdkScreen* screen) const
 {
 	const gchar* string = garcon_menu_item_get_command(m_item);
diff --git a/src/launcher.hpp b/src/launcher.hpp
index 1fdad30..e3a3885 100644
--- a/src/launcher.hpp
+++ b/src/launcher.hpp
@@ -17,6 +17,8 @@
 #ifndef WHISKERMENU_LAUNCHER_HPP
 #define WHISKERMENU_LAUNCHER_HPP
 
+#include "query.hpp"
+
 #include <map>
 #include <string>
 
@@ -29,8 +31,6 @@ extern "C"
 namespace WhiskerMenu
 {
 
-class Query;
-
 class Launcher
 {
 public:
@@ -52,7 +52,11 @@ public:
 		return m_item;
 	}
 
-	unsigned int get_search_results(const Query& query) const;
+	unsigned int get_search_results(const Query& query) const
+	{
+		std::map<std::string, unsigned int>::const_iterator i = m_searches.find(query.query());
+		return (i != m_searches.end()) ? i->second : UINT_MAX;
+	}
 
 	void run(GdkScreen* screen) const;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list