]> granicus.if.org Git - python/commitdiff
__setitem__: Use integer division for computing # of blocks.
authorTim Peters <tim.peters@gmail.com>
Fri, 11 Jul 2003 04:09:55 +0000 (04:09 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 11 Jul 2003 04:09:55 +0000 (04:09 +0000)
Lib/dumbdbm.py

index 2f6bc51dd915ead848b53fff7a159681483e6693..b932f84f906326b8f5f3dd486258d5ed95a9bd06 100644 (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