update.py: use a constant for the key modifier of defs_idxes
As Chris White said it, it's better to have only one line to change if we have to update that value. Signed-off-by: Maxime Chretien (MixLeNain) <mchretien@linuxmail.org>
This commit is contained in:
parent
10f08e33ea
commit
763e4fd1aa
1 changed files with 5 additions and 4 deletions
|
|
@ -54,7 +54,8 @@ tag_ready = Condition() # Waiting for new tags
|
|||
|
||||
new_idxes = [] # (new idxes, Event idxes ready, Event defs ready, Event comps ready, Event vers ready)
|
||||
bindings_idxes = [] # DT bindings documentation files
|
||||
defs_idxes = {} # Idents definitions stored with (idx*1 000 000 + line) as the key.
|
||||
idx_key_mod = 1000000
|
||||
defs_idxes = {} # Idents definitions stored with (idx*idx_key_mod + line) as the key.
|
||||
|
||||
tags_done = False # True if all tags have been added to new_idxes
|
||||
|
||||
|
|
@ -241,7 +242,7 @@ class UpdateDefs(Thread):
|
|||
type = type.decode()
|
||||
line = int(line.decode())
|
||||
|
||||
defs_idxes[idx*1000000+line] = ident
|
||||
defs_idxes[idx*idx_key_mod + line] = ident
|
||||
|
||||
if db.defs.exists(ident):
|
||||
obj = db.defs.get(ident)
|
||||
|
|
@ -315,8 +316,8 @@ class UpdateRefs(Thread):
|
|||
tok = prefix + tok
|
||||
|
||||
if (db.defs.exists(tok) and
|
||||
not ( (idx*1000000+line_num) in defs_idxes and
|
||||
defs_idxes[idx*1000000+line_num] == tok ) and
|
||||
not ( (idx*idx_key_mod + line_num) in defs_idxes and
|
||||
defs_idxes[idx*idx_key_mod + line_num] == tok ) and
|
||||
(family != 'M' or tok.startswith(b'CONFIG_'))):
|
||||
# We only index CONFIG_??? in makefiles
|
||||
if tok in idents:
|
||||
|
|
|
|||
Loading…
Reference in a new issue