mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04: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
484377b809
commit
7365b93c1a
1 changed files with 2 additions and 2 deletions
|
@ -150,13 +150,13 @@ class DeckManager:
|
||||||
self.col.sched.emptyDyn(did)
|
self.col.sched.emptyDyn(did)
|
||||||
if childrenToo:
|
if childrenToo:
|
||||||
for name, id in self.children(did):
|
for name, id in self.children(did):
|
||||||
self.rem(id, cardsToo)
|
self.rem(id, cardsToo, childrenToo=False)
|
||||||
else:
|
else:
|
||||||
# delete children first
|
# delete children first
|
||||||
if childrenToo:
|
if childrenToo:
|
||||||
# we don't want to delete children when syncing
|
# we don't want to delete children when syncing
|
||||||
for name, id in self.children(did):
|
for name, id in self.children(did):
|
||||||
self.rem(id, cardsToo)
|
self.rem(id, cardsToo, childrenToo=False)
|
||||||
# delete cards too?
|
# delete cards too?
|
||||||
if cardsToo:
|
if cardsToo:
|
||||||
# don't use cids(), as we want cards in cram decks too
|
# don't use cids(), as we want cards in cram decks too
|
||||||
|
|
Loading…
Reference in a new issue