diff mercurial/templatefilters.py @ 40030: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 e7aa113b14f7
children 4df7c4b70e03
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Tue Oct 02 12:43:54 2018 -0700
+++ b/mercurial/templatefilters.py	Wed Oct 03 10:27:44 2018 -0700
@@ -200,7 +200,7 @@
             if not m:
                 uctext = encoding.unifromlocal(text[start:])
                 w = len(uctext)
-                while 0 < w and uctext[w - 1].isspace():
+                while w > 0 and uctext[w - 1].isspace():
                     w -= 1
                 yield (encoding.unitolocal(uctext[:w]),
                        encoding.unitolocal(uctext[w:]))