From 4446b85ef262ad52f4a2c303607337e0208ae3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Sun, 10 Sep 2017 15:32:51 +0200 Subject: [PATCH] Simplify comparisons --- anki/models.py | 2 +- anki/sched.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/models.py b/anki/models.py index c32ae0be2..310a1a0fc 100644 --- a/anki/models.py +++ b/anki/models.py @@ -240,7 +240,7 @@ and notes.mid = ? and cards.ord = ?""", m['id'], ord) return m['sortf'] def setSortIdx(self, m, idx): - assert idx >= 0 and idx < len(m['flds']) + assert 0 <= idx < len(m['flds']) self.col.modSchema(check=True) m['sortf'] = idx self.col.updateFieldCache(self.nids(m)) diff --git a/anki/sched.py b/anki/sched.py index 5e9a8b22f..be6242b85 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -56,7 +56,7 @@ class Scheduler: def answerCard(self, card, ease): self.col.log() - assert ease >= 1 and ease <= 4 + assert 1 <= ease <= 4 self.col.markReview(card) if self._burySiblingsOnAnswer: self._burySiblings(card)