[Request] [+ ] D8898: hgweb: simplify a constant-length list by converting to literal tuple

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Aug 5 22:05:46 UTC 2020


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The call to `.append()` has been unnecessary since d3dbdca92458 <https://phab.mercurial-scm.org/rHGd3dbdca92458a522f41c0ccdc0c8d46865ee79c8>
  (hgweb: don't choke when an inexistent style is requested (issue1901),
  2009-11-12).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8898

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -79,8 +79,7 @@
                 and pycompat.osaltsep in style
             ):
                 continue
-            locations = [os.path.join(style, b'map'), b'map-' + style]
-            locations.append(b'map')
+            locations = (os.path.join(style, b'map'), b'map-' + style, b'map')
 
             for location in locations:
                 mapfile = os.path.join(path, location)



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200805/08bf5213/attachment.html>


More information about the Mercurial-patches mailing list