Merge pull request #209 from sieben/simplify_comparisons

Simplify comparisons
This commit is contained in:
Damien Elmes 2017-09-11 15:01:07 +10:00 committed by GitHub
commit bd414595de
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)