Skip to content

Commit

Permalink
Summonerd: Simplify reading phase1 root logic
Browse files Browse the repository at this point in the history
Signed-off-by: Lúcás Meier <[email protected]>
  • Loading branch information
cronokirby committed Oct 12, 2023
1 parent 6581d91 commit 7626552
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tools/summonerd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,7 @@ impl Opt {
let mut reader = BufReader::new(file);

let mut phase_1_bytes = Vec::new();
let mut buffer = [0; 4096 * 10]; // 40 KB chunks

loop {
let bytes_read = reader.read(&mut buffer)?;
if bytes_read == 0 {
break;
}
phase_1_bytes.extend_from_slice(&buffer[..bytes_read]);
}
reader.read_to_end(&mut phase_1_bytes)?;

let phase_1_raw_root = Phase1RawCeremonyCRS::unchecked_from_protobuf(
CeremonyCrs::decode(&phase_1_bytes[..])?,
Expand Down

0 comments on commit 7626552

Please sign in to comment.