single return in sched2 _deckRevLimitSingle

This commit is contained in:
Arthur Milchior 2020-03-01 13:38:42 +01:00
parent c35afd4aaa
commit c4b2ab96a6

View File

@ -867,14 +867,12 @@ and due <= ? limit ?)""",
lim = max(0, c["rev"]["perDay"] - d["revToday"][1]) lim = max(0, c["rev"]["perDay"] - d["revToday"][1])
if parentLimit is not None: if parentLimit is not None:
return min(parentLimit, lim) lim = min(parentLimit, lim)
elif "::" not in d["name"]: elif "::" in d["name"]:
return lim
else:
for parent in self.col.decks.parents(d["id"]): for parent in self.col.decks.parents(d["id"]):
# pass in dummy parentLimit so we don't do parent lookup again # pass in dummy parentLimit so we don't do parent lookup again
lim = min(lim, self._deckRevLimitSingle(parent, parentLimit=lim)) lim = min(lim, self._deckRevLimitSingle(parent, parentLimit=lim))
return lim return lim
def _revForDeck(self, did: int, lim: int, childMap: Dict[int, Any]) -> Any: def _revForDeck(self, did: int, lim: int, childMap: Dict[int, Any]) -> Any:
dids = [did] + self.col.decks.childDids(did, childMap) dids = [did] + self.col.decks.childDids(did, childMap)