Patchwork D8898: hgweb: simplify a constant-length list by converting to literal tuple

login
register
mail settings
Submitter phabricator
Date Aug. 5, 2020, 10:05 p.m.
Message ID <differential-rev-PHID-DREV-aitvy3v4iuwrh3hhtpcg-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46997/
State Superseded
Headers show

Comments

phabricator - Aug. 5, 2020, 10:05 p.m.
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




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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)