Skip to content
Snippets Groups Projects
Commit c4817610 authored by Matt Mackall's avatar Matt Mackall
Browse files

encoding: add fast-path for ASCII lowercase

parent ccc173d0
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment