From ae7d0dd2a440e4b7f44cde32c99cc7da5804e355 Mon Sep 17 00:00:00 2001 From: llama Date: Tue, 1 Jul 2025 08:53:16 +0800 Subject: [PATCH] strip clozes before stripping combining characters find_notes_sc time: [1.0398 s 1.0405 s 1.0412 s] change: [-6.1276% -6.0323% -5.9401%] (p = 0.00 < 0.05) Performance has improved. --- rslib/src/storage/sqlite.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index cd75ee117..2a38863cc 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -121,12 +121,12 @@ fn add_process_text_function(db: &Connection) -> rusqlite::Result<()> { |ctx| { let mut text = Cow::from(ctx.get_raw(0).as_str()?); let opt = ctx.get_raw(1).as_i64()? as u8; - if opt & 1 != 0 { - text = text.map_cow(without_combining); - } if opt & 2 != 0 { text = text.map_cow(strip_clozes); } + if opt & 1 != 0 { + text = text.map_cow(without_combining); + } Ok(text.get_owned()) }, )