mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Add a note about get_item_id() being slow
This commit is contained in:
parent
917f82385a
commit
d5d0a97d37
@ -947,7 +947,8 @@ class Cache:
|
|||||||
|
|
||||||
@read_api
|
@read_api
|
||||||
def get_item_id(self, field, item_name):
|
def get_item_id(self, field, item_name):
|
||||||
' Return the item id for item_name (case-insensitive) or None if not found '
|
'''' Return the item id for item_name (case-insensitive) or None if not found.
|
||||||
|
This function is very slow if doing lookups for multiple names use either get_item_ids() or get_item_name_map(). '''
|
||||||
q = icu_lower(item_name)
|
q = icu_lower(item_name)
|
||||||
try:
|
try:
|
||||||
for item_id, item_val in self.fields[field].table.id_map.items():
|
for item_id, item_val in self.fields[field].table.id_map.items():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user