mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Some memory improvements of @cachedmethod
This commit is contained in:
parent
58b87e4b6b
commit
9404b63a42
4 changed files with 8 additions and 7 deletions
|
|
@ -2691,6 +2691,7 @@ def enumValueToNameLookup(type_, value_):
|
|||
|
||||
return retVal
|
||||
|
||||
@cachedmethod
|
||||
def extractRegexResult(regex, content, flags=0):
|
||||
"""
|
||||
Returns 'result' group value from a possible match with regex on a given
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ def cachedmethod(f, cache={}):
|
|||
|
||||
def _(*args, **kwargs):
|
||||
try:
|
||||
key = (f, tuple(args), frozenset(kwargs.items()))
|
||||
key = hash((f, tuple(args), frozenset(kwargs.items())))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
except:
|
||||
key = "".join(str(_) for _ in (f, args, kwargs))
|
||||
key = hash("".join(str(_) for _ in (f, args, kwargs)))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
|||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.1.11.7"
|
||||
VERSION = "1.1.11.8"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue