changeset 31070:ebd14a4b03fc

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 16 Feb 2017 10:52:27 +0100
parents cf2bc3792ef4
children 350d737e059d
files hgext/color.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: