File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1111class JSONCompilationDatabase (CompilationDatabaseInterface ):
1212 def __init__ (self , json_db_path ):
1313 self .json_db_path = json_db_path
14+ self .__data = None
1415
1516 @classmethod
1617 def probe_directory (cls , directory ):
@@ -48,7 +49,7 @@ def _dict_to_compile_command(d):
4849
4950 @property
5051 def _data (self ):
51- if not hasattr ( self , ' __data' ) :
52+ if self . __data is None :
5253 with open (self .json_db_path ) as f :
5354 self .__data = json .load (f )
5455 return self .__data
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ class IncludedByDatabase(CompilationDatabaseInterface):
141141 def __init__ (self , graph , database ):
142142 self .graph = graph
143143 self .database = database
144+ self .__db_index = None
144145
145146 def __repr__ (self ):
146147 return '<IncludedByGraph: graph = {}, database = {}>' .format (
@@ -177,7 +178,7 @@ def _bfs_walk_from(self, path):
177178
178179 @property
179180 def _db_index (self ):
180- if not hasattr ( self , ' __db_index' ) :
181+ if self . __db_index is None :
181182 self .__db_index = frozenset (self .database .get_all_files ())
182183 return self .__db_index
183184
You can’t perform that action at this time.
0 commit comments