mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
Minor refactoring
This commit is contained in:
8
lib/core/decorators.py
Normal file
8
lib/core/decorators.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# Reference: http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/
|
||||
def cachedmethod(f, cache={}):
|
||||
def _(*args, **kwargs):
|
||||
key = (f, tuple(args), frozenset(kwargs.items()))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
return cache[key]
|
||||
return _
|
||||
Reference in New Issue
Block a user