Hi

Small tweak to the cache behavior.

- Lauri
>From 275d5d614d532ff37c813d60ea5ec689273cb169 Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <[email protected]>
Date: Wed, 6 Jun 2012 19:10:51 +0300
Subject: [PATCH] utils: If the passed date is current, we know it's not in cache


Signed-off-by: Lauri Kasanen <[email protected]>
---
 src/mk_utils.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mk_utils.c b/src/mk_utils.c
index 65529f1..a80c821 100644
--- a/src/mk_utils.c
+++ b/src/mk_utils.c
@@ -105,10 +105,11 @@ int mk_utils_utime2gmt(char **data, time_t date)
             return -1;
         }
     }
-
-    /* Maybe it's converted already? */
-    if (mk_utils_gmt_cache_get(data, date) == MK_TRUE) {
-        return size;
+    else {
+        /* Maybe it's converted already? */
+        if (mk_utils_gmt_cache_get(data, date) == MK_TRUE) {
+            return size;
+        }
     }
 
     /* Convert unix time to struct tm */
-- 
1.7.2.1

_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to