Simplify zero check

This commit is contained in:
Andreas Liljeqvist 2021-08-23 15:52:47 +02:00
parent 32d7e5b723
commit d92810646e

View File

@ -710,7 +710,7 @@ impl WrappingRange {
/// Equal to `range.contains(0)` but should be faster.
#[inline]
pub fn contains_zero(&self) -> bool {
!(self.start <= self.end && self.start != 0)
self.start > self.end || self.start == 0
}
/// Returns new `WrappingRange` with replaced `start`