File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ class _MmapedDict(object):
315315 The file starts with a 4 byte int, indicating how much of it is used.
316316 Then 4 bytes of padding.
317317 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
319319 alignment, and then a 8 byte float which is the value.
320320 """
321321 def __init__ (self , filename ):
@@ -343,7 +343,7 @@ def _init_value(self, key):
343343 value = struct .pack ('i{0}sd' .format (len (padded )).encode (), len (encoded ), padded , 0.0 )
344344 while self ._used + len (value ) > self ._capacity :
345345 self ._capacity *= 2
346- self ._f .truncate (self ._capacity * 2 )
346+ self ._f .truncate (self ._capacity )
347347 self ._m = mmap .mmap (self ._f .fileno (), self ._capacity )
348348 self ._m [self ._used :self ._used + len (value )] = value
349349
You can’t perform that action at this time.
0 commit comments