mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 14:29:10 -05:00
Remove useless recursion in DeckManager.rem
For any deck the children of it's children are its children. So applying rem to children of children is useless and actually slightly costly for deep subdecks
This commit is contained in:
parent
1834b65714
commit
c837143d31
1 changed files with 2 additions and 2 deletions
|
|
@ -150,13 +150,13 @@ class DeckManager:
|
|||
self.col.sched.emptyDyn(did)
|
||||
if childrenToo:
|
||||
for name, id in self.children(did):
|
||||
self.rem(id, cardsToo)
|
||||
self.rem(id, cardsToo, childrenToo=False)
|
||||
else:
|
||||
# delete children first
|
||||
if childrenToo:
|
||||
# we don't want to delete children when syncing
|
||||
for name, id in self.children(did):
|
||||
self.rem(id, cardsToo)
|
||||
self.rem(id, cardsToo, childrenToo=False)
|
||||
# delete cards too?
|
||||
if cardsToo:
|
||||
# don't use cids(), as we want cards in cram decks too
|
||||
|
|
|
|||
Loading…
Reference in a new issue