Commit 2f0a2384 authored by Dmitry Trofimov's avatar Dmitry Trofimov
Browse files

Remove redundancy

parent 6eed7a81
Showing with 3 additions and 11 deletions
+3 -11
......@@ -133,21 +133,13 @@ class CallSignatureCache(object):
def add(self, signature):
filename, name, args_type = get_signature_info(signature)
if not filename in self.cache:
self.cache[filename] = {}
calls_from_file = self.cache[filename]
if not name in calls_from_file:
calls_from_file[name] = {}
name_calls = calls_from_file[name]
calls_from_file = self.cache.setdefault(filename, {})
name_calls = calls_from_file.setdefault(name, {})
name_calls[args_type] = None
def is_in_cache(self, signature):
filename, name, args_type = get_signature_info(signature)
if filename in self.cache and name in self.cache[filename] and args_type in self.cache[filename][name]:
if args_type in self.cache.get(filename, {}).get(name, {}):
return True
return False
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment