Skip to content

Commit

Permalink
even more leftover code
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Oct 28, 2024
1 parent 06ceae2 commit 00fbc86
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/vm2/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ impl<T, W> fmt::Debug for Program<T, W> {
impl<T: Tracer, W: World<T>> Program<T, W> {
/// Creates a new program.
#[allow(clippy::missing_panics_doc)] // false positive
pub fn new(bytecode: &[u8], enable_hooks: bool) -> Self {
pub fn new(bytecode: &[u8]) -> Self {
let instructions = decode_program(
&bytecode
.chunks_exact(8)
.map(|chunk| u64::from_be_bytes(chunk.try_into().unwrap()))
.collect::<Vec<_>>(),
enable_hooks,
);
let code_page = bytecode
.chunks_exact(32)
Expand All @@ -73,13 +72,12 @@ impl<T: Tracer, W: World<T>> Program<T, W> {
}

/// Creates a new program from `U256` words.
pub fn from_words(bytecode_words: Vec<U256>, enable_hooks: bool) -> Self {
pub fn from_words(bytecode_words: Vec<U256>) -> Self {
let instructions = decode_program(
&bytecode_words
.iter()
.flat_map(|x| x.0.into_iter().rev())
.collect::<Vec<_>>(),
enable_hooks,
);
Self {
instructions: instructions.into(),
Expand Down

0 comments on commit 00fbc86

Please sign in to comment.