mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 04:31:30 +00:00
Some memory improvements of @cachedmethod
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user