Read about our upcoming Code of Conduct on this issue

Commit c11d741e authored by Carl Friedrich Bolz-Tereick's avatar Carl Friedrich Bolz-Tereick
Browse files

untranslated charp2str in its full generality is reeeeaaally slow, which is bad

for applevel tests. have a we_are_translated version
parent ca966f994f0f
......@@ -838,6 +838,16 @@ def make_string_mappings(strtype):
# char* -> str
# doesn't free char*
def charp2str(cp):
if not we_are_translated():
res = []
size = 0
while True:
c = cp[size]
if c == lastchar:
return assert_str0("".join(res))
res.append(c)
size += 1
size = 0
while cp[size] != lastchar:
size += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment