/// Multiply `x` correctly with a `SizeHint`. #[inline] pubfn mul_scalar(sh: SizeHint, x: usize) -> SizeHint { let (mut low, mut hi) = sh;
low = low.saturating_mul(x);
hi = hi.and_then(|elt| elt.checked_mul(x));
(low, hi)
}
/// Raise `base` correctly by a `SizeHint` exponent. #[inline] pubfn pow_scalar_base(base: usize, exp: SizeHint) -> SizeHint { let exp_low = cmp::min(exp.0, u32::MAX as usize) as u32; let low = base.saturating_pow(exp_low);
let hi = exp.1.and_then(|exp| { let exp_hi = cmp::min(exp, u32::MAX as usize) as u32;
base.checked_pow(exp_hi)
});
(low, hi)
}
/// Return the maximum #[inline] pubfn max(a: SizeHint, b: SizeHint) -> SizeHint { let (a_lower, a_upper) = a; let (b_lower, b_upper) = b;
let lower = cmp::max(a_lower, b_lower);
let upper = match (a_upper, b_upper) {
(Some(x), Some(y)) => Some(cmp::max(x, y)),
_ => None,
};
(lower, upper)
}
/// Return the minimum #[inline] pubfn min(a: SizeHint, b: SizeHint) -> SizeHint { let (a_lower, a_upper) = a; let (b_lower, b_upper) = b; let lower = cmp::min(a_lower, b_lower); let upper = match (a_upper, b_upper) {
(Some(u1), Some(u2)) => Some(cmp::min(u1, u2)),
_ => a_upper.or(b_upper),
};
(lower, upper)
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.