Unify compilation_database access

`file` and `arguments` are accessed using the square bracket syntax, while `output` is accessed using `.get()`. This commit uses square brackets for all three. This will throw a `KeyError` if `compilation_database` does not have the key, which is the correct behaviour IMO.
This commit is contained in:
Luflosi 2019-06-26 14:54:50 +02:00
parent 7598a2965c
commit 4708b592e2
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362

View File

@ -428,7 +428,7 @@ class CompilationDatabase:
except FileNotFoundError:
compilation_database = []
compilation_database = {
CompileKey(k['file'], k.get('output')): k['arguments'] for k in compilation_database
CompileKey(k['file'], k['output']): k['arguments'] for k in compilation_database
}
self.db = compilation_database
return self