Commit 0ec031fa authored by Claudio Freire's avatar Claudio Freire

Initialize hashes during string init to enable hash-compare optimization

parent 17b1f1fe
......@@ -14,6 +14,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
//////////////////// InitStrings ////////////////////
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
long hash;
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
......@@ -38,6 +39,9 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
#endif
if (!*t->p)
return -1;
hash = PyObject_Hash(*t->p);
if (hash == -1)
PyErr_Clear();
++t;
}
return 0;
......
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