Browse Source

Avoid dict:is_empty/1 for compat with old OTP versions

Viktor Söderqvist 10 years ago
parent
commit
2b51002a40
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/mysql_cache.erl

+ 3 - 3
src/mysql_cache.erl

@@ -44,9 +44,9 @@ evict_older_than({cache, StartTs, Dict}, MaxAge) ->
         end,
         end,
         {[], dict:new()},
         {[], dict:new()},
         Dict),
         Dict),
-    Cache1 = case dict:is_empty(Dict1) of
-        true  -> empty;
-        false -> {cache, StartTs, Dict1}
+    Cache1 = case dict:size(Dict1) of
+        0 -> empty;
+        _ -> {cache, StartTs, Dict1}
     end,
     end,
     {Evicted, Cache1};
     {Evicted, Cache1};
 evict_older_than(empty, _) ->
 evict_older_than(empty, _) ->