dualsourcecache: simplify cachekey.clear
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 17 May 2017 12:23:10 +0200
changeset 2387 a41d900d015c
parent 2386 47ee05940d7d
child 2388 385156ab55b8
dualsourcecache: simplify cachekey.clear We do not needs the super call anymore and we can make the reset case more explicit. So we do.
hgext3rd/evolve/obscache.py
--- a/hgext3rd/evolve/obscache.py	Wed May 17 11:58:48 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Wed May 17 12:23:10 2017 +0200
@@ -161,10 +161,10 @@
         """
         # /!\ IMPORTANT /!\
         # You must overide this method to actually
-        self._cachekey = self.emptykey if reset else None
-        s = super(dualsourcecache, self)
-        if util.safehasattr(s, 'clear') and callable(s.clear):
-            s.clear()
+        if reset:
+            self._cachekey = self.emptykey if reset else None
+        else:
+            self._cachekey = None
 
     def load(self, repo):
         """Load data from disk