From 9acf3185726a4db7af9064371cb42d320dad6b6c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 2 Jun 2020 13:32:36 +1000 Subject: [PATCH] skip note update if unchanged --- rslib/src/notes.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rslib/src/notes.rs b/rslib/src/notes.rs index 6fa56f95f..9f0733dcd 100644 --- a/rslib/src/notes.rs +++ b/rslib/src/notes.rs @@ -261,6 +261,13 @@ impl Collection { } pub fn update_note(&mut self, note: &mut Note) -> Result<()> { + if let Some(existing_note) = self.storage.get_note(note.id)? { + if &existing_note == note { + // nothing to do + return Ok(()); + } + } + self.transact(None, |col| { let nt = col .get_notetype(note.ntid)?