diff options
author | Guido van Rossum <guido@python.org> | 2007-09-18 19:42:40 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-09-18 19:42:40 +0000 |
commit | 16a0d0158d37cc62abcd24c73acf7cf9a17a0fad (patch) | |
tree | 18a901dc2d78597e71bc6e230bf8d17b95e64134 /Python/compile.c | |
parent | 9425a372bf7fa47ae55384c9d9ac4e2a2da7ca1d (diff) | |
download | cpython-16a0d0158d37cc62abcd24c73acf7cf9a17a0fad.tar.gz |
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 'Python/compile.c')
0 files changed, 0 insertions, 0 deletions