mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Micro-optimization for get_categories() by using __slots__
This commit is contained in:
parent
ef50b1a823
commit
c6bdca08aa
@ -21,6 +21,11 @@ CATEGORY_SORTS = ('name', 'popularity', 'rating') # This has to be a tuple not
|
|||||||
|
|
||||||
class Tag(object):
|
class Tag(object):
|
||||||
|
|
||||||
|
if tweaks.get('use_new_db', False):
|
||||||
|
__slots__ = ('name', 'original_name', 'id', 'count', 'state', 'is_hierarchical',
|
||||||
|
'is_editable', 'is_searchable', 'id_set', 'avg_rating', 'sort',
|
||||||
|
'use_sort_as_name', 'tooltip', 'icon', 'category')
|
||||||
|
|
||||||
def __init__(self, name, id=None, count=0, state=0, avg=0, sort=None,
|
def __init__(self, name, id=None, count=0, state=0, avg=0, sort=None,
|
||||||
tooltip=None, icon=None, category=None, id_set=None,
|
tooltip=None, icon=None, category=None, id_set=None,
|
||||||
is_editable=True, is_searchable=True, use_sort_as_name=False):
|
is_editable=True, is_searchable=True, use_sort_as_name=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user