File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,17 +86,15 @@ def entry_sort_key(entry, fields):
8686 result .append (str (entry .get (field , '' )).lower ()) # Sorting always as string
8787 return tuple (result )
8888
89- def _make_entries_dict (self ):
90- for entry in self .entries :
91- self ._entries_dict [entry ['ID' ]] = entry
92-
9389 def get_entry_dict (self ):
94- """Return a dictionary of BibTeX entries.
95- The dict key is the BibTeX entry key
90+ """Return a dictionary of BibTeX entries, where dict key is the BibTeX entry key.
91+
92+ This method re-creates the dict every time it is called,
93+ hence subsequent calls should be avoided with large databases.
9694 """
97- # If the hash has never been made, make it
98- if not self ._entries_dict :
99- self ._make_entries_dict ()
95+ self . _entries_dict = dict ()
96+ for entry in self .entries :
97+ self ._entries_dict [ entry [ 'ID' ]] = entry
10098 return self ._entries_dict
10199
102100 entries_dict = property (get_entry_dict )
You can’t perform that action at this time.
0 commit comments