Skip to content

Commit

Permalink
efficient unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvsadana committed Oct 25, 2023
1 parent ede1227 commit a89e190
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/hints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,7 @@ pub fn prepare_constructor_execution(
};
insert_value_from_var_name("constructor_calldata_size", constructor_calldata_size, vm, ids_data, ap_tracking)?;

let constructor_calldata: Vec<MaybeRelocatable> = match tx.constructor_calldata {
None => vec![],
Some(calldata) => calldata.iter().map(|felt| felt.into()).collect(),
};
let constructor_calldata = tx.constructor_calldata.unwrap_or_default().iter().map(|felt| felt.into()).collect();
let constructor_calldata_base = vm.add_memory_segment();
vm.load_data(constructor_calldata_base, &constructor_calldata)?;
insert_value_from_var_name("constructor_calldata", constructor_calldata_base, vm, ids_data, ap_tracking)
Expand Down

0 comments on commit a89e190

Please sign in to comment.