Skip to content

Commit f80b7a9

Browse files
authored
Update executor.rs
1 parent f2ad126 commit f80b7a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vm/src/emulator/executor.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,10 @@ impl HarvardEmulator {
467467
.unwrap();
468468

469469
// Add the public input length to the beginning of the public input.
470-
let len_bytes = (public_input.len()) as u32;
471-
let public_input_with_len = [&len_bytes.to_le_bytes()[..], public_input].concat();
470+
let len_bytes = public_input.len() as u32;
471+
let mut public_input_with_len = Vec::with_capacity(WORD_SIZE + public_input.len());
472+
public_input_with_len.extend_from_slice(&len_bytes.to_le_bytes());
473+
public_input_with_len.extend_from_slice(public_input);
472474

473475
let mut emulator = Self {
474476
executor: Executor {

0 commit comments

Comments
 (0)