anjuta r3827 - in trunk: . plugins/symbol-db



Author: jhs
Date: Mon Apr  7 18:12:45 2008
New Revision: 3827
URL: http://svn.gnome.org/viewvc/anjuta?rev=3827&view=rev

Log:
2008-04-07  Johannes Schmid  <jhs gnome org>

	* plugins/symbol-db/symbol-db-engine.c (sdb_engine_cache_lookup),
	(sdb_engine_add_new_sym_kind), (sdb_engine_add_new_sym_access),
	(sdb_engine_add_new_sym_implementation):
	
	Fixed some issues with caching

Modified:
   trunk/ChangeLog
   trunk/plugins/symbol-db/symbol-db-engine.c
   trunk/plugins/symbol-db/symbol-db-view.c

Modified: trunk/plugins/symbol-db/symbol-db-engine.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-engine.c	Mon Apr  7 18:12:45 2008
@@ -581,12 +581,16 @@
 											g_free,
 											NULL);
 	}
+	else
 	{
-		gpointer id = g_hash_table_lookup (*hash_table, 
-										   lookup);
-		if (id)
+		gpointer orig_key = NULL;
+		gpointer value = NULL;
+		if (g_hash_table_lookup_extended (*hash_table, 
+										  lookup,
+										  &orig_key,
+										  &value))
 		{
-			gint table_id = GPOINTER_TO_INT (id);
+			gint table_id = GPOINTER_TO_INT (value);
 			return table_id;
 		}
 	}
@@ -2774,8 +2778,11 @@
 	if (kind_name == NULL)
 		return -1;
 
-	if ((table_id = sdb_engine_cache_lookup (&priv->kind_cache, kind_name) != -1))
+	table_id = sdb_engine_cache_lookup (&priv->kind_cache, kind_name);
+	if (table_id != -1)
+	{
 		return table_id;
+	}
 
 	value = gda_value_new (G_TYPE_STRING);
 	g_value_set_string (value, kind_name);
@@ -2859,8 +2866,11 @@
 		return -1;
 	}
 	
-	if ((table_id = sdb_engine_cache_lookup (&priv->access_cache, access) != -1))
+	table_id = sdb_engine_cache_lookup (&priv->access_cache, access);
+	if (table_id != -1)
+	{
 		return table_id;
+	}
 
 	
 	value = gda_value_new (G_TYPE_STRING);
@@ -2946,8 +2956,11 @@
 		/* no implementation associated with current tag */
 		return -1;
 	}
-	if ((table_id = sdb_engine_cache_lookup (&priv->implementation_cache, implementation) != -1))
+	table_id = sdb_engine_cache_lookup (&priv->implementation_cache, implementation);
+	if (table_id != -1)
+	{
 		return table_id;
+	}
 	
 	value = gda_value_new (G_TYPE_STRING);
 	g_value_set_string (value, implementation);

Modified: trunk/plugins/symbol-db/symbol-db-view.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-view.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-view.c	Mon Apr  7 18:12:45 2008
@@ -467,7 +467,7 @@
 	
 	g_return_if_fail (dbv != NULL);	
 	priv = dbv->priv;
-
+	
 	/* add to root if parent_symbol_id is <= 0 */
 	if (parent_symbol_id <= 0)
 	{



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