Skip to content

Fix potential KeyError in merge_compdb()#122

Open
i-ky wants to merge 1 commit into
nickdiego:mainfrom
i-ky:merge_compdb-key-error-fix
Open

Fix potential KeyError in merge_compdb()#122
i-ky wants to merge 1 commit into
nickdiego:mainfrom
i-ky:merge_compdb-key-error-fix

Conversation

@i-ky

@i-ky i-ky commented Mar 7, 2022

Copy link
Copy Markdown

At the point where entry['directory'] is used, 'directory' is definitely not in entry as checked in if two lines above

if 'directory' in entry:
On the other hand, 'file' is guaranteed to be in entry, because gen_key(c) is called only if 'file' in c
orig = {gen_key(c): c for c in compdb if 'file' in c}
new = {gen_key(c): c for c in new_compdb if 'file' in c}
This looks like a "typo".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant