rcutil: extract duplicated logic to a lambda
This simplifies the code a bit.
--- a/mercurial/rcutil.py Tue Mar 28 07:55:32 2017 -0700
+++ b/mercurial/rcutil.py Tue Mar 28 07:57:56 2017 -0700
@@ -85,9 +85,8 @@
continue
_rccomponents.extend(('path', p) for p in _expandrcpath(p))
else:
- paths = defaultrcpath() + systemrcpath()
- _rccomponents = [('path', os.path.normpath(p)) for p in paths]
+ normpaths = lambda paths: [('path', os.path.normpath(p)) for p in paths]
+ _rccomponents = normpaths(defaultrcpath() + systemrcpath())
_rccomponents.append(envrc)
- paths = userrcpath()
- _rccomponents.extend(('path', os.path.normpath(p)) for p in paths)
+ _rccomponents.extend(normpaths(userrcpath()))
return _rccomponents