summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2006-05-22 16:29:30 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2006-05-22 16:29:30 (GMT)
commitf1d60a53845d2efeccdb61bebf6ee8df94df16d4 (patch)
treee94e4f8352ee740ad313550f1a3b7863c28c441c /Include/unicodeobject.h
parentd82c3105cced4ef0b8d99f1703dda4c4bf4cc0b5 (diff)
downloadcpython-f1d60a53845d2efeccdb61bebf6ee8df94df16d4.zip
cpython-f1d60a53845d2efeccdb61bebf6ee8df94df16d4.tar.gz
cpython-f1d60a53845d2efeccdb61bebf6ee8df94df16d4.tar.bz2
needforspeed: speed up unicode repeat, unicode string copy
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 9012257..7917c68 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -352,12 +352,15 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
Py_UNICODE_ISDIGIT(ch) || \
Py_UNICODE_ISNUMERIC(ch))
-#define Py_UNICODE_COPY(target, source, length)\
- (memcpy((target), (source), (length)*sizeof(Py_UNICODE)))
+#define Py_UNICODE_COPY(target, source, length) do\
+ {int i; Py_UNICODE *t = (target); const Py_UNICODE *s = (source);\
+ for (i = 0; i < (length); i++) t[i] = s[i];\
+ } while (0)
#define Py_UNICODE_FILL(target, value, length) do\
- {int i; for (i = 0; i < (length); i++) (target)[i] = (value);}\
- while (0)
+ {int i; Py_UNICODE *t = (target); Py_UNICODE v = (value);\
+ for (i = 0; i < (length); i++) t[i] = v;\
+ } while (0)
#define Py_UNICODE_MATCH(string, offset, substring)\
((*((string)->str + (offset)) == *((substring)->str)) &&\