From ae690ccea3e9704b5db9226ea6e7ccce35727983 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 9 Feb 2010 01:36:39 +0900 Subject: [PATCH] don't bother with an integrity check if the deck is unchanged --- anki/deck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index ac91fffde..430f15bac 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -3340,9 +3340,6 @@ nextFactor, reps, thinkingTime, yesCount, noCount from reviewHistory""") """Path must not be unicode.""" if not numBackups: return - # check integrity - if not deck.s.scalar("pragma integrity_check") == "ok": - raise DeckAccessError(_("Deck is corrupt."), type="corrupt") def escape(path): path = os.path.abspath(path) path = path.replace("\\", "!") @@ -3364,6 +3361,9 @@ nextFactor, reps, thinkingTime, yesCount, noCount from reviewHistory""") if int(deck.modified) == int( os.stat(latest)[stat.ST_MTIME]): return + # check integrity + if not deck.s.scalar("pragma integrity_check") == "ok": + raise DeckAccessError(_("Deck is corrupt."), type="corrupt") # get next num if not backups: n = 1