cleaner arithmetic

This commit is contained in:
Dmitry Vagner 2023-02-15 18:50:26 -08:00
parent 731c29c43b
commit abc762f7b4

View File

@ -57,10 +57,7 @@ fn make_interpreter_setup(
} }
fn combine_u256s(hi: U256, lo: U256) -> U512 { fn combine_u256s(hi: U256, lo: U256) -> U512 {
let mut result = U512::from(hi); U512::from(lo) + (U512::from(hi) << 256)
result <<= 256;
result += U512::from(lo);
result
} }
fn prepare_test<T>( fn prepare_test<T>(