mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-29 09:29:50 +03:00
Refactoring for use MAX_INT
This commit is contained in:
parent
ce4726390f
commit
2a07f529ed
|
@ -20,6 +20,7 @@ from lib.core.enums import MKSTEMP_PREFIX
|
||||||
from lib.core.exception import SqlmapSystemException
|
from lib.core.exception import SqlmapSystemException
|
||||||
from lib.core.settings import BIGARRAY_CHUNK_SIZE
|
from lib.core.settings import BIGARRAY_CHUNK_SIZE
|
||||||
from lib.core.settings import BIGARRAY_COMPRESS_LEVEL
|
from lib.core.settings import BIGARRAY_COMPRESS_LEVEL
|
||||||
|
from lib.core.settings import MAX_INT
|
||||||
|
|
||||||
DEFAULT_SIZE_OF = sys.getsizeof(object())
|
DEFAULT_SIZE_OF = sys.getsizeof(object())
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ class BigArray(list):
|
||||||
|
|
||||||
def __init__(self, items=[]):
|
def __init__(self, items=[]):
|
||||||
self.chunks = [[]]
|
self.chunks = [[]]
|
||||||
self.chunk_length = sys.maxsize
|
self.chunk_length = MAX_INT
|
||||||
self.cache = None
|
self.cache = None
|
||||||
self.filenames = set()
|
self.filenames = set()
|
||||||
self._os_remove = os.remove
|
self._os_remove = os.remove
|
||||||
|
@ -66,7 +67,7 @@ class BigArray(list):
|
||||||
def append(self, value):
|
def append(self, value):
|
||||||
self.chunks[-1].append(value)
|
self.chunks[-1].append(value)
|
||||||
|
|
||||||
if self.chunk_length == sys.maxsize:
|
if self.chunk_length == MAX_INT:
|
||||||
self._size_counter += _size_of(value)
|
self._size_counter += _size_of(value)
|
||||||
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
|
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
|
||||||
self.chunk_length = len(self.chunks[-1])
|
self.chunk_length = len(self.chunks[-1])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user