[tracker/wip/carlosg/batches-and-resources: 2/5] libtracker-data: Fix bnode cache lookups
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/batches-and-resources: 2/5] libtracker-data: Fix bnode cache lookups
- Date: Fri, 11 Dec 2020 10:53:13 +0000 (UTC)
commit cb04f9826ba9100a697832d2c93eea2109c657aa
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Dec 6 18:39:00 2020 +0100
libtracker-data: Fix bnode cache lookups
We use resource identifiers as the hashtable key, but were looking
up on the resource pointer here. Oops.
src/libtracker-data/tracker-data-update.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index d2ebef193..0c8e05c5f 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -1567,13 +1567,13 @@ get_bnode_for_resource (GHashTable *bnodes,
const gchar *identifier;
gchar *bnode;
- bnode = g_hash_table_lookup (bnodes, resource);
+ identifier = tracker_resource_get_identifier (resource);
+ bnode = g_hash_table_lookup (bnodes, identifier);
if (bnode)
return bnode;
iface = tracker_data_manager_get_writable_db_interface (data->manager);
bnode = tracker_data_update_ensure_new_bnode (data, iface, NULL);
- identifier = tracker_resource_get_identifier (resource);
g_hash_table_insert (bnodes, g_strdup (identifier), bnode);
return bnode;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]