Rev 5168: If we use the key[i] form, we don't need the CheckExact call. in http://bazaar.launchpad.net/~jameinel/bzr/other/gz-double-zlib
John Arbash Meinel
john at arbash-meinel.com
Thu Apr 29 21:16:24 BST 2010
At http://bazaar.launchpad.net/~jameinel/bzr/other/gz-double-zlib
------------------------------------------------------------
revno: 5168
revision-id: john at arbash-meinel.com-20100429201618-b9n9vchd59ieftfu
parent: john at arbash-meinel.com-20100429171926-jiekibi2mfp9ku8b
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: gz-double-zlib
timestamp: Thu 2010-04-29 15:16:18 -0500
message:
If we use the key[i] form, we don't need the CheckExact call.
-------------- next part --------------
=== modified file 'bzrlib/_chk_map_pyx.pyx'
--- a/bzrlib/_chk_map_pyx.pyx 2010-04-29 17:19:26 +0000
+++ b/bzrlib/_chk_map_pyx.pyx 2010-04-29 20:16:18 +0000
@@ -102,8 +102,6 @@
cdef Py_ssize_t out_off
cdef char *c_out
- if not StaticTuple_CheckExact(key):
- raise TypeError('key %r is not a StaticTuple' % (key,))
num_bits = len(key)
# 4 bytes per crc32, and another 1 byte between bits
num_out_bytes = (9 * num_bits) - 1
@@ -113,9 +111,6 @@
if i > 0:
c_out[0] = c'\x00'
c_out = c_out + 1
- # We use the _ptr variant, because GET_ITEM returns a borrowed
- # reference, and Pyrex assumes that returned 'object' are a new
- # reference
crc_val = PyInt_AsUnsignedLongMask(crc32(key[i]))
# Hex(val) order
sprintf(c_out, '%08X', crc_val)
@@ -132,8 +127,6 @@
cdef Py_ssize_t out_off
cdef char *c_out
- if not StaticTuple_CheckExact(key):
- raise TypeError('key %r is not a StaticTuple' % (key,))
num_bits = len(key)
# 4 bytes per crc32, and another 1 byte between bits
num_out_bytes = (5 * num_bits) - 1
More information about the bazaar-commits
mailing list