Mercurial > hg-stable
diff mercurial/encoding.py @ 16387:c481761033bd
encoding: add fast-path for ASCII lowercase
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 10 Apr 2012 12:07:18 -0500 |
parents | 5d75eb8568d1 |
children | 72c6240a4b7d |
line wrap: on
line diff
--- a/mercurial/encoding.py Tue Apr 10 12:07:16 2012 -0500 +++ b/mercurial/encoding.py Tue Apr 10 12:07:18 2012 -0500 @@ -168,6 +168,10 @@ def lower(s): "best-effort encoding-aware case-folding of local string s" try: + return s.encode('ascii').lower() + except UnicodeDecodeError: + pass + try: if isinstance(s, localstr): u = s._utf8.decode("utf-8") else: