remove OnceLock from decomposed amount

This commit is contained in:
syf 2024-02-10 17:55:44 +01:00
parent 0d8f71b4c7
commit 53e7cf25f0

View file

@ -1,13 +1,8 @@
use std::sync::OnceLock;
/// Decomposed amount table. /// Decomposed amount table.
/// ///
static DECOMPOSED_AMOUNTS: OnceLock<[u64; 172]> = OnceLock::new();
#[rustfmt::skip] #[rustfmt::skip]
pub fn decomposed_amounts() -> &'static [u64; 172] { static DECOMPOSED_AMOUNTS: [u64; 172] =
DECOMPOSED_AMOUNTS.get_or_init(|| { [
[
1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 20, 30, 40, 50, 60, 70, 80, 90, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100, 200, 300, 400, 500, 600, 700, 800, 900, 100, 200, 300, 400, 500, 600, 700, 800, 900,
@ -28,8 +23,11 @@ pub fn decomposed_amounts() -> &'static [u64; 172] {
100000000000000000, 200000000000000000, 300000000000000000, 400000000000000000, 500000000000000000, 600000000000000000, 700000000000000000, 800000000000000000, 900000000000000000, 100000000000000000, 200000000000000000, 300000000000000000, 400000000000000000, 500000000000000000, 600000000000000000, 700000000000000000, 800000000000000000, 900000000000000000,
1000000000000000000, 2000000000000000000, 3000000000000000000, 4000000000000000000, 5000000000000000000, 6000000000000000000, 7000000000000000000, 8000000000000000000, 9000000000000000000, 1000000000000000000, 2000000000000000000, 3000000000000000000, 4000000000000000000, 5000000000000000000, 6000000000000000000, 7000000000000000000, 8000000000000000000, 9000000000000000000,
10000000000000000000 10000000000000000000
] ];
})
#[inline]
pub fn decomposed_amounts() -> &'static [u64; 172] {
&DECOMPOSED_AMOUNTS
} }
/// Checks that an output amount is decomposed. /// Checks that an output amount is decomposed.