Simplify comparisons

This commit is contained in:
Rémy Léone 2017-09-10 15:32:51 +02:00
parent 67728e73d7
commit 4446b85ef2
2 changed files with 2 additions and 2 deletions

View File

@ -240,7 +240,7 @@ and notes.mid = ? and cards.ord = ?""", m['id'], ord)
return m['sortf'] return m['sortf']
def setSortIdx(self, m, idx): def setSortIdx(self, m, idx):
assert idx >= 0 and idx < len(m['flds']) assert 0 <= idx < len(m['flds'])
self.col.modSchema(check=True) self.col.modSchema(check=True)
m['sortf'] = idx m['sortf'] = idx
self.col.updateFieldCache(self.nids(m)) self.col.updateFieldCache(self.nids(m))

View File

@ -56,7 +56,7 @@ class Scheduler:
def answerCard(self, card, ease): def answerCard(self, card, ease):
self.col.log() self.col.log()
assert ease >= 1 and ease <= 4 assert 1 <= ease <= 4
self.col.markReview(card) self.col.markReview(card)
if self._burySiblingsOnAnswer: if self._burySiblingsOnAnswer:
self._burySiblings(card) self._burySiblings(card)