Skip to content

Commit

Permalink
Move assertion up
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Jun 14, 2024
1 parent a9b346a commit 0e3bf1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ipa-core/src/protocol/ipa_prf/aggregation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ where
{
// Step used to add trigger values.
type AdditionStep = ThirtyTwoBitStep;
assert!(
OV::BITS <= AdditionStep::BITS,
"{} not large enough to accommodate the sum of {} bit values",
type_name::<AdditionStep>(),
OV::BITS,
);

let mut depth = 0;
while num_rows > 1 {
Expand Down Expand Up @@ -271,12 +277,6 @@ where
}
Ok(mut chunk_pair) => {
assert_eq!(chunk_pair.len(), 2);
assert!(
OV::BITS <= AdditionStep::BITS,
"{} not large enough to accommodate the sum of {} bit values",
type_name::<AdditionStep>(),
OV::BITS,
);
let b = chunk_pair.pop().unwrap();
let a = chunk_pair.pop().unwrap();
let record_id = RecordId::from(i);
Expand Down

0 comments on commit 0e3bf1a

Please sign in to comment.