diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-11 01:17:47 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-11 01:17:47 (GMT) |
commit | 28716985466df10b7eb1ad34816e2d273b228b07 (patch) | |
tree | bccb7a0dbf4dda4b3c03fe3797dbcabbe24f2071 /Objects | |
parent | 53bb548f227f6223e89e1cf2a92aaf4d1261bfd4 (diff) | |
download | cpython-28716985466df10b7eb1ad34816e2d273b228b07.zip cpython-28716985466df10b7eb1ad34816e2d273b228b07.tar.gz cpython-28716985466df10b7eb1ad34816e2d273b228b07.tar.bz2 |
/* Remove unused code. It has been committed out since 2000 (!). */
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 84b5024..091f964 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -10043,58 +10043,6 @@ unicode_center(PyObject *self, PyObject *args) return pad(self, left, marg - left, fillchar); } -#if 0 - -/* This code should go into some future Unicode collation support - module. The basic comparison should compare ordinals on a naive - basis (this is what Java does and thus Jython too). */ - -/* speedy UTF-16 code point order comparison */ -/* gleaned from: */ -/* http://www-4.ibm.com/software/developer/library/utf16.html?dwzone=unicode */ - -static short utf16Fixup[32] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0x2000, -0x800, -0x800, -0x800, -0x800 -}; - -static int -unicode_compare(PyUnicodeObject *str1, PyUnicodeObject *str2) -{ - Py_ssize_t len1, len2; - - Py_UNICODE *s1 = str1->str; - Py_UNICODE *s2 = str2->str; - - len1 = str1->_base._base.length; - len2 = str2->_base._base.length; - - while (len1 > 0 && len2 > 0) { - Py_UNICODE c1, c2; - - c1 = *s1++; - c2 = *s2++; - - if (c1 > (1<<11) * 26) - c1 += utf16Fixup[c1>>11]; - if (c2 > (1<<11) * 26) - c2 += utf16Fixup[c2>>11]; - /* now c1 and c2 are in UTF-32-compatible order */ - - if (c1 != c2) - return (c1 < c2) ? -1 : 1; - - len1--; len2--; - } - - return (len1 < len2) ? -1 : (len1 != len2); -} - -#else - /* This function assumes that str1 and str2 are readied by the caller. */ static int @@ -10123,8 +10071,6 @@ unicode_compare(PyUnicodeObject *str1, PyUnicodeObject *str2) return (len1 < len2) ? -1 : (len1 != len2); } -#endif - int PyUnicode_Compare(PyObject *left, PyObject *right) { |