# HG changeset patch
# User Pierre-Yves David <pierre-yves.da...@ens-lyon.org>
# Date 1482370203 -3600
#      Thu Dec 22 02:30:03 2016 +0100
# Node ID 07618a3840fbce3ab1084765d94ac8d7a9380ff8
# Parent  bb59bec58bcdf57a3aeb1a9cd4a9b5b004c7c139
# EXP-Topic color
color: rework conditional 'valideffect'

Not very important, but the full conditional is not that hard to follow and
having it unified make the function role a bit clearer in my opinion.

diff -r bb59bec58bcd -r 07618a3840fb mercurial/color.py
--- a/mercurial/color.py        Thu Dec 22 02:26:50 2016 +0100
+++ b/mercurial/color.py        Thu Dec 22 02:30:03 2016 +0100
@@ -116,10 +116,6 @@ def loadcolortable(ui, extname, colortab
 
 def valideffect(effect):
     'Determine if the effect is valid or not.'
-    good = False
-    if not _terminfo_params and effect in _effects:
-        good = True
-    elif (effect in _terminfo_params
-          or effect[:-11] in _terminfo_params):
-        good = True
-    return good
+    return ((not _terminfo_params and effect in _effects)
+             or (effect in _terminfo_params
+                 or effect[:-11] in _terminfo_params))
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to