summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-09-18 19:42:40 (GMT)
committerGuido van Rossum <guido@python.org>2007-09-18 19:42:40 (GMT)
commitc2504931ee6bb19b4d38d0d654b02a6fbc797ebd (patch)
treeae0fac70cd3c00538e97315db099f26d3f634d35 /Tools
parente4a9e788d367b99162a0b584d23f4fd111bde1cf (diff)
downloadcpython-c2504931ee6bb19b4d38d0d654b02a6fbc797ebd.zip
cpython-c2504931ee6bb19b4d38d0d654b02a6fbc797ebd.tar.gz
cpython-c2504931ee6bb19b4d38d0d654b02a6fbc797ebd.tar.bz2
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.
Diffstat (limited to 'Tools')
0 files changed, 0 insertions, 0 deletions