Refactoring for use MAX_INT

This commit is contained in:
akun 2018-03-07 17:24:13 +08:00
parent ce4726390f
commit 2a07f529ed

View File

@ -20,6 +20,7 @@ from lib.core.enums import MKSTEMP_PREFIX
from lib.core.exception import SqlmapSystemException
from lib.core.settings import BIGARRAY_CHUNK_SIZE
from lib.core.settings import BIGARRAY_COMPRESS_LEVEL
from lib.core.settings import MAX_INT
DEFAULT_SIZE_OF = sys.getsizeof(object())
@ -54,7 +55,7 @@ class BigArray(list):
def __init__(self, items=[]):
self.chunks = [[]]
self.chunk_length = sys.maxsize
self.chunk_length = MAX_INT
self.cache = None
self.filenames = set()
self._os_remove = os.remove
@ -66,7 +67,7 @@ class BigArray(list):
def append(self, value):
self.chunks[-1].append(value)
if self.chunk_length == sys.maxsize:
if self.chunk_length == MAX_INT:
self._size_counter += _size_of(value)
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
self.chunk_length = len(self.chunks[-1])