diff hgext/shelve.py @ 40029:e2697acd9381

cleanup: some Yoda conditions, this patch removes It seems the factor 20 is less than the frequency of " < \d" compared to " \d > ". Differential Revision: https://phab.mercurial-scm.org/D4862
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 Oct 2018 10:27:44 -0700
parents d9ba836fc234
children c303d65d2e34
line wrap: on
line diff
--- a/hgext/shelve.py	Tue Oct 02 12:43:54 2018 -0700
+++ b/hgext/shelve.py	Wed Oct 03 10:27:44 2018 -0700
@@ -302,7 +302,7 @@
     hgfiles = [f for f in vfs.listdir()
                if f.endswith('.' + patchextension)]
     hgfiles = sorted([(vfs.stat(f)[stat.ST_MTIME], f) for f in hgfiles])
-    if 0 < maxbackups and maxbackups < len(hgfiles):
+    if maxbackups > 0 and maxbackups < len(hgfiles):
         bordermtime = hgfiles[-maxbackups][0]
     else:
         bordermtime = None