Skip to content

Commit

Permalink
test(s2n-quic-core): only check IntervalSet integrity in tests (#2131)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Feb 20, 2024
1 parent a7ea486 commit f6d64db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions quic/s2n-quic-core/src/interval_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,13 @@ impl<T: IntervalBound> IntervalSet<T> {
}
}

/// Internal check for integrity - only used when debug_assertions are enabled
/// Internal check for integrity - only used when `cfg(test)` is enabled
#[inline]
fn check_integrity(&self) {
if cfg!(debug_assertions) {
// When using this data structure outside of this crate, these checks are quite expensive.
// Rather than using `cfg(debug_assertions)`, we limit it to `cfg(test)`, which will just
// turn them on when testing this crate.
if cfg!(test) {
let mut prev_end: Option<T> = None;

for interval in self.intervals.iter() {
Expand Down

0 comments on commit f6d64db

Please sign in to comment.