# HG changeset patch # User Jun Wu # Date 1490713076 25200 # Node ID 10d88dc7c010ac3ebd1272960bca54bbe81079b7 # Parent 67f0377bd24bca396473e60743eb80e765f98b8a rcutil: extract duplicated logic to a lambda This simplifies the code a bit. diff -r 67f0377bd24b -r 10d88dc7c010 mercurial/rcutil.py --- 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