From 2809156d53a99b862c318c95ae71249d004cab32 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 2 Mar 2023 20:12:51 +0800 Subject: [PATCH] perf: generate `ALL_SHORT_CODES` --- src/rust_ffi/src/all_cases.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rust_ffi/src/all_cases.rs b/src/rust_ffi/src/all_cases.rs index ebc69e9..eecb894 100644 --- a/src/rust_ffi/src/all_cases.rs +++ b/src/rust_ffi/src/all_cases.rs @@ -21,9 +21,11 @@ lazy_static! { }; static ref ALL_SHORT_CODES: Vec = { - ShortCode::warm_up_fast(); - build_all_cases().iter() - .map(|code| CommonCode::new(*code).to_short_code()) + let all_cases_size = unsafe { + Core::ALL_CASES_SIZE + }; + (0..all_cases_size) + .map(|code| ShortCode::new(code)) .collect() }; }