[meld] matchers.helpers: Tweak the cache cleaning size limit



commit 2ccc54225568c8638028b9387f2e1e655bd3943d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jul 16 10:40:24 2017 +1000

    matchers.helpers: Tweak the cache cleaning size limit
    
    This is only a hint, so tweaking the limit to be less-than-or-equal
    rather than strictly less has no real effect on normal use, *except*
    that we now don't immediately clean an empty cache when we start.

 meld/matchers/helpers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/matchers/helpers.py b/meld/matchers/helpers.py
index d6f43d9..5710c9b 100644
--- a/meld/matchers/helpers.py
+++ b/meld/matchers/helpers.py
@@ -94,7 +94,7 @@ class CachedSequenceMatcher(object):
 
         @param size_hint: the recommended minimum number of cache entries
         """
-        if len(self.cache) < size_hint * 3:
+        if len(self.cache) <= size_hint * 3:
             return
         items = list(self.cache.items())
         items.sort(key=lambda it: it[1][1])


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