mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
skip note update if unchanged
This commit is contained in:
parent
4d7e23111e
commit
9acf318572
1 changed files with 7 additions and 0 deletions
|
@ -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)?
|
||||||
|
|
Loading…
Reference in a new issue