skip note update if unchanged

This commit is contained in:
Damien Elmes 2020-06-02 13:32:36 +10:00
parent 4d7e23111e
commit 9acf318572

View file

@ -261,6 +261,13 @@ impl Collection {
} }
pub fn update_note(&mut self, note: &mut Note) -> Result<()> { 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| { self.transact(None, |col| {
let nt = col let nt = col
.get_notetype(note.ntid)? .get_notetype(note.ntid)?