mirror of
https://github.com/ankitects/anki.git
synced 2025-12-05 10:57:11 -05:00
NF: sligthly optimize cards.py (#3870)
As AnkiDroid wants to be similar to Anki, instead of making AnkiDroid slightly less efficient, I prefer to slightly improve Anki. AnkiDroid related PR: https://github.com/ankidroid/Anki-Android/pull/18112.
This commit is contained in:
parent
83d0f5dae9
commit
6ef24739fc
1 changed files with 3 additions and 2 deletions
|
|
@ -172,10 +172,11 @@ class Card(DeprecatedNamesMixin):
|
||||||
|
|
||||||
def template(self) -> TemplateDict:
|
def template(self) -> TemplateDict:
|
||||||
notetype = self.note_type()
|
notetype = self.note_type()
|
||||||
|
templates = notetype["tmpls"]
|
||||||
if notetype["type"] == MODEL_STD:
|
if notetype["type"] == MODEL_STD:
|
||||||
return self.note_type()["tmpls"][self.ord]
|
return templates[self.ord]
|
||||||
else:
|
else:
|
||||||
return self.note_type()["tmpls"][0]
|
return templates[0]
|
||||||
|
|
||||||
def start_timer(self) -> None:
|
def start_timer(self) -> None:
|
||||||
self.timer_started = time.time()
|
self.timer_started = time.time()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue