__setitem__: Use integer division for computing # of blocks.

This commit is contained in:
Tim Peters 2003-07-11 04:09:55 +00:00
parent 663d1b61cb
commit ef6573e529
1 changed files with 2 additions and 2 deletions

View File

@ -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