SIGN IN SIGN UP

Optimize unicode_hash() by not calling

_PyUnicode_AsDefaultEncodedString() at all -- this saves two object
allocations (three block allocations!)  and lots of redundant work.
By using the same hash algorithm as string_hash(), we maintain the
invariant that the hash of an ASCII string is the same whether
represented as a PyString or a PyUnicode.
G
Guido van Rossum committed
c2504931ee6bb19b4d38d0d654b02a6fbc797ebd
Parent: e4a9e78