File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ class _MmapedDict(object):
315
315
The file starts with a 4 byte int, indicating how much of it is used.
316
316
Then 4 bytes of padding.
317
317
There's then a number of entries, consisting of a 4 byte int which is the
318
- side of the next field, a utf-8 encoded string key, padding to a 8 byte
318
+ size of the next field, a utf-8 encoded string key, padding to a 8 byte
319
319
alignment, and then a 8 byte float which is the value.
320
320
"""
321
321
def __init__ (self , filename ):
@@ -343,7 +343,7 @@ def _init_value(self, key):
343
343
value = struct .pack ('i{0}sd' .format (len (padded )).encode (), len (encoded ), padded , 0.0 )
344
344
while self ._used + len (value ) > self ._capacity :
345
345
self ._capacity *= 2
346
- self ._f .truncate (self ._capacity * 2 )
346
+ self ._f .truncate (self ._capacity )
347
347
self ._m = mmap .mmap (self ._f .fileno (), self ._capacity )
348
348
self ._m [self ._used :self ._used + len (value )] = value
349
349
You can’t perform that action at this time.
0 commit comments