Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r60242:727405791c06
Date: 2013-01-20 17:32 +0200
http://bitbucket.org/pypy/pypy/changeset/727405791c06/
Log: remove strange copies for now. I think some explanations is needed
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -58,26 +58,6 @@
# generate surrogates for large codes
return UNICHR(code)
-
-def UNICHR(c):
- if c <= sys.maxunicode and c <= MAXUNICODE:
- return unichr(c)
- else:
- c -= 0x10000
- return (unichr(0xD800 + (c >> 10)) +
- unichr(0xDC00 + (c & 0x03FF)))
-
-def ORD(u):
- assert isinstance(u, unicode)
- if len(u) == 1:
- return ord(u[0])
- elif len(u) == 2:
- ch1 = ord(u[0])
- ch2 = ord(u[1])
- if 0xD800 <= ch1 <= 0xDBFF and 0xDC00 <= ch2 <= 0xDFFF:
- return (((ch1 - 0xD800) << 10) | (ch2 - 0xDC00)) + 0x10000
- raise ValueError
-
def _STORECHAR(result, CH, byteorder):
hi = chr(((CH) >> 8) & 0xff)
lo = chr((CH) & 0xff)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit