[tracker/miner-fs-queries-performance] TrackerMinerFS: Improve condition in ensure_iri_cache().
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-queries-performance] TrackerMinerFS: Improve condition in ensure_iri_cache().
- Date: Thu, 22 Apr 2010 11:20:07 +0000 (UTC)
commit 600e03b6a3010e291cdd2a192a60e6e3022e6b0e
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Apr 22 11:51:42 2010 +0200
TrackerMinerFS: Improve condition in ensure_iri_cache().
src/libtracker-miner/tracker-miner-fs.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index b980b2e..0251b48 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2182,17 +2182,17 @@ ensure_mtime_cache (TrackerMinerFS *fs,
parent = g_file_get_parent (file);
- if (fs->private->current_parent &&
- g_file_equal (parent, fs->private->current_parent)) {
- g_object_unref (parent);
- return;
- }
-
if (fs->private->current_parent) {
- g_object_unref (fs->private->current_parent);
+ if (g_file_equal (parent, fs->private->current_parent)) {
+ /* Cache is still valid */
+ g_object_unref (parent);
+ return;
+ } else {
+ g_object_unref (fs->private->current_parent);
+ fs->private->current_parent = parent;
+ }
}
- fs->private->current_parent = parent;
g_hash_table_remove_all (fs->private->mtime_cache);
uri = g_file_get_uri (parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]