Skip to content

Commit

Permalink
Avoid Extra Allocation (paritytech#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav authored Jul 7, 2022
1 parent 175e42f commit d80c5fe
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions template/runtime/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ where
pub fn new() -> Self {
Self(Default::default())
}
pub fn used_addresses() -> sp_std::vec::Vec<H160> {
sp_std::vec![1, 2, 3, 4, 5, 1024, 1025]
.into_iter()
.map(hash)
.collect()
pub fn used_addresses() -> [H160; 7] {
[
hash(1),
hash(2),
hash(3),
hash(4),
hash(5),
hash(1024),
hash(1025),
]
}
}
impl<R> PrecompileSet for FrontierPrecompiles<R>
Expand Down

0 comments on commit d80c5fe

Please sign in to comment.