]> git.lizzy.rs Git - rust.git/commitdiff
Simplify zero check
authorAndreas Liljeqvist <bonega@gmail.com>
Mon, 23 Aug 2021 13:52:47 +0000 (15:52 +0200)
committerAndreas Liljeqvist <bonega@gmail.com>
Mon, 23 Aug 2021 13:52:47 +0000 (15:52 +0200)
compiler/rustc_target/src/abi/mod.rs

index 6e2f8962eef4899e75c9c3c32a2ddfb327439b47..b352243c0c44ea7c3c8657617ab655254fe15c47 100644 (file)
@@ -710,7 +710,7 @@ pub fn contains(&self, v: u128) -> bool {
     /// 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`