diff options
| author | 2020-05-17 09:25:37 +0300 | |
|---|---|---|
| committer | 2020-05-17 09:25:37 +0300 | |
| commit | e3be25f8d64db4adec36798700423191916353d8 (patch) | |
| tree | 65c4b6fb381edec51ad2d2ff45293cbf37fc9409 | |
| parent | PEP Improvisations: Move errors sending from PEP command to `get_pep_embed` (diff) | |
PEP Improvisations: Simplify cache item check on `async_cache` decorator
Co-authored-by: Mark <[email protected]>
| -rw-r--r-- | bot/utils/cache.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/utils/cache.py b/bot/utils/cache.py index 338924df8..1c0935faa 100644 --- a/bot/utils/cache.py +++ b/bot/utils/cache.py @@ -21,8 +21,7 @@ def async_cache(max_size: int = 128, arg_offset: int = 0) -> Callable: """Decorator wrapper for the caching logic.""" key = ':'.join(str(args[arg_offset:])) - value = async_cache.cache.get(key) - if value is None: + if key in async_cache.cache: if len(async_cache.cache) > max_size: async_cache.cache.popitem(last=False) |