Mercurial > paraspace
view paraspace/tools.py @ 142:50d09eba5166
Fix the issue of getting negative indices for _DEX_ClassData.
- It caused by calling _optimize_classdata() at end of restore_dependencies()
while the values cames from depend_idx_rel.get_value(). The values had
been optimized.
- Solution is to get value from <child>.data_idx while unlinking.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 15 Aug 2011 10:04:12 +0800 |
parents | ff6f869273b7 |
children |
line wrap: on
line source
base = 65521 adler32_init_value = 1 def adler32(adler, buf, offset, sz): sum1 = adler & 0xffff sum2 = (adler >> 16) & 0xffff for off in range(offset, offset + sz): sum1 = (sum1 + ord(buf[off])) % base sum2 = (sum2 + sum1) % base pass r = (sum2 << 16) | sum1 return r