Skip to content

Commit

Permalink
remove reserve, as its perf impact is minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jul 24, 2024
1 parent 619beb4 commit 88bc3b2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/heap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::instruction_handlers::HeapInterface;
use std::ops::{Index, IndexMut, Range};
use std::ops::{Index, Range};
use u256::U256;
use zkevm_opcode_defs::system_params::NEW_FRAME_MEMORY_STIPEND;

Expand All @@ -20,12 +20,6 @@ impl HeapId {
#[derive(Debug, Clone, PartialEq)]
pub struct Heap(Vec<u8>);

impl Heap {
pub fn reserve(&mut self, additional: usize) {
self.0.reserve_exact(additional);
}
}

impl HeapInterface for Heap {
fn read_u256(&self, start_address: u32) -> U256 {
self.read_u256_partially(start_address..start_address + 32)
Expand Down Expand Up @@ -124,12 +118,6 @@ impl Index<HeapId> for Heaps {
}
}

impl IndexMut<HeapId> for Heaps {
fn index_mut(&mut self, index: HeapId) -> &mut Self::Output {
&mut self.heaps[index.0 as usize]
}
}

impl PartialEq for Heaps {
fn eq(&self, other: &Self) -> bool {
for i in 0..self.heaps.len().max(other.heaps.len()) {
Expand Down

0 comments on commit 88bc3b2

Please sign in to comment.