mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
speed up unquote() by using atoi() instead of eval()
This commit is contained in:
parent
44a4d59b56
commit
8c8a02a258
1 changed files with 1 additions and 1 deletions
|
@ -645,7 +645,7 @@ def unquote(s):
|
|||
if j < 0:
|
||||
res = res + s[i:]
|
||||
break
|
||||
res = res + (s[i:j] + chr(eval('0x' + s[j+1:j+3])))
|
||||
res = res + (s[i:j] + chr(string.atoi(s[j+1:j+3], 16)))
|
||||
i = j+3
|
||||
return res
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue