[tracker/wip/carlosg/data-update-error-propagation: 1/11] libtracker-data: Minor refactor
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/data-update-error-propagation: 1/11] libtracker-data: Minor refactor
- Date: Sun, 21 Feb 2021 19:31:58 +0000 (UTC)
commit 5ee0b352a37bf66e776515ed4b7ea42c35543801
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Feb 21 17:48:27 2021 +0100
libtracker-data: Minor refactor
Reorder a bit the code, and don't account for NULL subject which
must not happen here.
src/libtracker-data/tracker-data-update.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index a6b6c9665..0072d73a9 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2254,19 +2254,20 @@ resource_buffer_switch (TrackerData *data,
if (data->resource_buffer == NULL) {
TrackerDataUpdateBufferResource *resource_buffer;
- gchar *subject_dup = NULL;
+ gchar *subject_dup;
+ gint resource_id;
/* subject not yet in cache, retrieve or create ID */
- resource_buffer = g_slice_new0 (TrackerDataUpdateBufferResource);
- if (subject != NULL) {
- subject_dup = g_strdup (subject);
- resource_buffer->subject = subject_dup;
- }
-
- resource_buffer->id =
+ resource_id =
tracker_data_update_ensure_resource (data,
- resource_buffer->subject,
+ subject,
NULL);
+
+ resource_buffer = g_slice_new0 (TrackerDataUpdateBufferResource);
+ resource_buffer->id = resource_id;
+ subject_dup = g_strdup (subject);
+ resource_buffer->subject = subject_dup;
+
resource_buffer->create =
g_hash_table_contains (data->update_buffer.new_resources,
resource_buffer->subject);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]