[anjuta] language-support-cpp-java: speeded up queries.



commit 9556f5a02bf378c21b6ba52be06e6231a41f7636
Author: Massimo Corà <mcora src gnome org>
Date:   Thu Jul 30 19:31:07 2009 +0200

    language-support-cpp-java: speeded up queries.
    
    Using parameter IANJUTA_SYMBOL_TYPE_UNDEF instead of IANJUTA_SYMBOL_TYPE_MAX is much
    faster because the query will be built without the filtering of all the symbol types: it'll just
    skip the filter (which means include all).

 libanjuta/interfaces/libanjuta.idl                 |   17 +++++++++--------
 .../language-support-cpp-java/cpp-java-assist.c    |    6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index bb9380e..2230fd8 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -4911,7 +4911,8 @@ interface IAnjutaSymbol
 	 * @IANJUTA_SYMBOL_TYPE_FILE: File (Pseudo tag) 
 	 * @IANJUTA_SYMBOL_TYPE_OTHER: Other (non C/C++/Java tag) 
 	 * @IANJUTA_SYMBOL_TYPE_SCOPE_CONTAINER: types which are subjected to create a scope.
-	 * @IANJUTA_SYMBOL_TYPE_MAX: Maximum value, means all known values.
+	 * @IANJUTA_SYMBOL_TYPE_MAX: Maximum value, means all known values. You can reach
+	 * the same result using IANJUTA_SYMBOL_TYPE_UNDEF, which is much faster.
 	 */                   
 	enum Type               
 	{
@@ -5138,7 +5139,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5165,7 +5166,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_system:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5187,7 +5188,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_project_async:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5213,7 +5214,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_project:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5234,7 +5235,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_project_async:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5260,7 +5261,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_file:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
@@ -5282,7 +5283,7 @@ interface IAnjutaSymbolManager
 	/**
 	* ianjuta_symbol_manager_search_file_async:
 	* @obj: Self
-	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_MAX the function will not perfom any filter.
+	* @match_types: If passed #IANJUTA_SYMBOL_TYPE_UNDEF the function will not perfom any filter.
 	* @include_types: Should the result contain or exclude the match_types? TRUE to include them,
 	*				  FALSE to exclude. For example use may want all symbols but classes.
 	* @info_fields: Kind of infos you would like to have available on the resulting Symbols.
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index cc9f22e..d57e1b9 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -518,7 +518,7 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
 			if (file != NULL)
 			{				
 				IAnjutaIterable* iter_file = ianjuta_symbol_manager_search_file (assist->priv->isymbol_manager,
-																				 IANJUTA_SYMBOL_TYPE_MAX,
+																				 IANJUTA_SYMBOL_TYPE_UNDEF,
 																				 TRUE,
 																				 IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
 																				 pattern, file, -1, -1, NULL);
@@ -534,14 +534,14 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
 		
 		IAnjutaIterable* iter_project = 
 			ianjuta_symbol_manager_search_project (assist->priv->isymbol_manager,
-										   IANJUTA_SYMBOL_TYPE_MAX,
+										   IANJUTA_SYMBOL_TYPE_UNDEF,
 										   TRUE,
 										   IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
 										   pattern, -1, -1, NULL);
 		
 		IAnjutaIterable* iter_globals = 
 			ianjuta_symbol_manager_search_system (assist->priv->isymbol_manager,
-										   IANJUTA_SYMBOL_TYPE_MAX,
+										   IANJUTA_SYMBOL_TYPE_UNDEF,
 										   TRUE,
 										   IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
 										   pattern, -1, -1, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]