[tracker/wip/carlosg/libtracker-miner-cleanups: 7/36] libtracker-miner: Simplify code a bit



commit b95b6cdb5dfbe959040af95e44f9409a0f6119ef
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Oct 9 23:14:30 2017 +0200

    libtracker-miner: Simplify code a bit
    
    We can steal data sooner in order to avoid unsetting the data in the early
    return path.

 src/libtracker-miner/tracker-file-notifier.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 6975813..1e9db65 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -282,24 +282,22 @@ file_notifier_traverse_tree_foreach (GFile    *file,
        priv = notifier->priv;
        current_root = priv->current_index_root->current_dir;
 
+       store_mtime = tracker_file_system_steal_property (priv->file_system, file,
+                                                         quark_property_store_mtime);
+       disk_mtime = tracker_file_system_steal_property (priv->file_system, file,
+                                                        quark_property_filesystem_mtime);
+
        /* If we're crawling over a subdirectory of a root index, it's been
         * already notified in the crawling op that made it processed, so avoid
         * it here again.
         */
        if (current_root == file &&
            current_root != priv->current_index_root->root) {
-               tracker_file_system_unset_property (priv->file_system, file,
-                                                   quark_property_filesystem_mtime);
-               tracker_file_system_unset_property (priv->file_system, file,
-                                                   quark_property_store_mtime);
+               g_free (store_mtime);
+               g_free (disk_mtime);
                return FALSE;
        }
 
-       store_mtime = tracker_file_system_steal_property (priv->file_system, file,
-                                                         quark_property_store_mtime);
-       disk_mtime = tracker_file_system_steal_property (priv->file_system, file,
-                                                        quark_property_filesystem_mtime);
-
        if (store_mtime && !disk_mtime) {
                /* In store but not in disk, delete */
                g_signal_emit (notifier, signals[FILE_DELETED], 0, file);


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