Patchwork D8001: pathauditor: drop a redundant call to bytes.lower()

login
register
mail settings
Submitter phabricator
Date Jan. 25, 2020, 1:40 a.m.
Message ID <differential-rev-PHID-DREV-apc5asu6gg4d223upvta-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44649/
State Superseded
Headers show

Comments

phabricator - Jan. 25, 2020, 1:40 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `_lowerclean(s)` calls `s.lower()`, so we don't need to do that before
  calling it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/pathutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/pathutil.py b/mercurial/pathutil.py
--- a/mercurial/pathutil.py
+++ b/mercurial/pathutil.py
@@ -84,7 +84,7 @@ 
                         _(b"path contains illegal component: %s") % path
                     )
         if b'.hg' in _lowerclean(path):
-            lparts = [_lowerclean(p.lower()) for p in parts]
+            lparts = [_lowerclean(p) for p in parts]
             for p in b'.hg', b'.hg.':
                 if p in lparts[1:]:
                     pos = lparts.index(p)