mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
__setitem__: Use integer division for computing # of blocks.
This commit is contained in:
parent
663d1b61cb
commit
ef6573e529
1 changed files with 2 additions and 2 deletions
|
@ -114,8 +114,8 @@ class _Database(UserDict.DictMixin):
|
|||
self._addkey(key, (pos, siz))
|
||||
else:
|
||||
pos, siz = self._index[key]
|
||||
oldblocks = (siz + _BLOCKSIZE - 1) / _BLOCKSIZE
|
||||
newblocks = (len(val) + _BLOCKSIZE - 1) / _BLOCKSIZE
|
||||
oldblocks = (siz + _BLOCKSIZE - 1) // _BLOCKSIZE
|
||||
newblocks = (len(val) + _BLOCKSIZE - 1) // _BLOCKSIZE
|
||||
if newblocks <= oldblocks:
|
||||
pos, siz = self._setval(pos, val)
|
||||
self._index[key] = pos, siz
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue