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:
Arthur Milchior 2025-03-19 02:14:13 +01:00 committed by GitHub
parent 83d0f5dae9
commit 6ef24739fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,10 +172,11 @@ class Card(DeprecatedNamesMixin):
def template(self) -> TemplateDict:
notetype = self.note_type()
templates = notetype["tmpls"]
if notetype["type"] == MODEL_STD:
return self.note_type()["tmpls"][self.ord]
return templates[self.ord]
else:
return self.note_type()["tmpls"][0]
return templates[0]
def start_timer(self) -> None:
self.timer_started = time.time()