for f in self.files:
f_entries = self.importer.extract(f, existing_entries=journal.entries)
// collect all entries in current statement, grouped by hash
hashed_entries = defaultdict(list)
for entry in f_entries:
key_ = self._get_key_from_imported_entry(entry)
self._add_description(entry)
hashed_entries[key_].append(entry)
// deduplicate across statements
for key_ in hashed_entries:
// skip the existing entries from other statements. add remaining
After Change
for f in self.files:
f_entries = self.importer.extract(f, existing_entries=journal.entries)
// collect all entries in current statement, grouped by hash
hashed_entries = OrderedDict() //type: Dict[Hashable, Directive]
for entry in f_entries:
key_ = self._get_key_from_imported_entry(entry)
self._add_description(entry)