Some obvious evm & uint optimizations (#1576)

* fix name and tests for endians

* using renamed func

* zero and sign opt
This commit is contained in:
Nikolay Volf
2016-07-10 20:18:23 +02:00
committed by Gav Wood
parent d7caae2241
commit e15f631ec7
5 changed files with 62 additions and 20 deletions

View File

@@ -445,7 +445,7 @@ macro_rules! impl_hash {
impl From<U256> for H256 {
fn from(value: U256) -> H256 {
let mut ret = H256::new();
value.to_raw_bytes(&mut ret);
value.to_big_endian(&mut ret);
ret
}
}
@@ -453,7 +453,7 @@ impl From<U256> for H256 {
impl<'a> From<&'a U256> for H256 {
fn from(value: &'a U256) -> H256 {
let mut ret: H256 = H256::new();
value.to_raw_bytes(&mut ret);
value.to_big_endian(&mut ret);
ret
}
}