color: merge two identical 'for' loops
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 16 Feb 2017 10:52:27 +0100
changeset 31087 ebd14a4b03fc
parent 31086 cf2bc3792ef4
child 31088 350d737e059d
color: merge two identical 'for' loops The previous changeset made it clear that we are iterating twice on the same items. We gather the two loops into a single one.
hgext/color.py
--- a/hgext/color.py	Thu Dec 22 13:06:53 2016 +0100
+++ b/hgext/color.py	Thu Feb 16 10:52:27 2017 +0100
@@ -206,9 +206,7 @@
         if key.startswith('color.'):
             newval = (False, int(val), '')
             color._terminfo_params[key[6:]] = newval
-
-    for key, val in ui.configitems('color'):
-        if key.startswith('terminfo.'):
+        elif key.startswith('terminfo.'):
             newval = (True, '', val.replace('\\E', '\x1b'))
             color._terminfo_params[key[9:]] = newval
     try: