Serhiy Storchaka added the comment:

Note that unicode_eq() always called after identity check and hash check. I.e. 
identity check in Victor's patch is redundant and unicode_eq() called only for 
strings which have the same hash. The probability to have the same first byte 
and be equal is a great.

unicode_compare_eq() and unicode_eq() are designed for different purposes. They 
cannot be just merged.

As the optimization for unicode_eq(), I would have suggested a checking of 
first machine words instead of first bytes, but this trick is too dirty.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17628>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to