[tracker/wip/carlosg/update-perf: 49/65] core: Avoid expanding property names for lookups
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/update-perf: 49/65] core: Avoid expanding property names for lookups
- Date: Tue, 23 Aug 2022 09:32:54 +0000 (UTC)
commit 5a4ef4451a4cff0d361ea85da53213f5b027827d
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Aug 18 23:19:05 2022 +0200
core: Avoid expanding property names for lookups
We can no look up properties in either short or long URI form, so
the URI expansion can be avoided here.
src/libtracker-sparql/core/tracker-data-update.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/src/libtracker-sparql/core/tracker-data-update.c
b/src/libtracker-sparql/core/tracker-data-update.c
index 740a29d39..4de63971d 100644
--- a/src/libtracker-sparql/core/tracker-data-update.c
+++ b/src/libtracker-sparql/core/tracker-data-update.c
@@ -3335,22 +3335,17 @@ update_resource_property (TrackerData *data,
TrackerOntologies *ontologies;
TrackerProperty *predicate;
GList *values, *v;
- gchar *property_uri;
GError *inner_error = NULL;
values = tracker_resource_get_values (resource, property);
- tracker_data_manager_expand_prefix (data->manager,
- property,
- NULL, NULL,
- &property_uri);
ontologies = tracker_data_manager_get_ontologies (data->manager);
- predicate = tracker_ontologies_get_property_by_uri (ontologies, property_uri);
+ predicate = tracker_ontologies_get_property_by_uri (ontologies, property);
if (predicate == NULL) {
g_set_error (error, TRACKER_SPARQL_ERROR,
TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY,
"Property '%s' not found in the ontology",
- property_uri);
+ property);
return FALSE;
}
@@ -3413,7 +3408,6 @@ update_resource_property (TrackerData *data,
}
g_list_free (values);
- g_free (property_uri);
if (inner_error) {
g_propagate_error (error, inner_error);
@@ -3487,23 +3481,13 @@ update_resource_single (TrackerData *data,
const gchar *property = l->data;
if (tracker_resource_get_property_overwrite (resource, property)) {
- gchar *property_uri;
-
- tracker_data_manager_expand_prefix (data->manager,
- property,
- NULL, NULL,
- &property_uri);
-
if (resource_maybe_reset_property (data, graph_uri, resource,
- subject, property_uri,
+ subject, property,
bnodes, &inner_error)) {
need_flush = TRUE;
} else if (inner_error) {
- g_free (property_uri);
goto out;
}
-
- g_free (property_uri);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]