Browse Source

perf: generate `ALL_SHORT_CODES`

legacy
Dnomd343 2 years ago
parent
commit
2809156d53
  1. 8
      src/rust_ffi/src/all_cases.rs

8
src/rust_ffi/src/all_cases.rs

@ -21,9 +21,11 @@ lazy_static! {
}; };
static ref ALL_SHORT_CODES: Vec<ShortCode> = { static ref ALL_SHORT_CODES: Vec<ShortCode> = {
ShortCode::warm_up_fast(); let all_cases_size = unsafe {
build_all_cases().iter() Core::ALL_CASES_SIZE
.map(|code| CommonCode::new(*code).to_short_code()) };
(0..all_cases_size)
.map(|code| ShortCode::new(code))
.collect() .collect()
}; };
} }

Loading…
Cancel
Save