speed up unquote() by using atoi() instead of eval()
This commit is contained in:
parent
44a4d59b56
commit
8c8a02a258
|
@ -645,7 +645,7 @@ def unquote(s):
|
||||||
if j < 0:
|
if j < 0:
|
||||||
res = res + s[i:]
|
res = res + s[i:]
|
||||||
break
|
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
|
i = j+3
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue