From 93b9d616cfe6815379fb559c429e7ccdc6ba1e7e Mon Sep 17 00:00:00 2001 From: Dmitry Sinyavin Date: Thu, 28 Sep 2023 19:42:11 +0200 Subject: [PATCH] Eliminate redundant branch --- polkadot/node/tracking-allocator/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/node/tracking-allocator/src/lib.rs b/polkadot/node/tracking-allocator/src/lib.rs index e9f1a99b221c..53126d144b0b 100644 --- a/polkadot/node/tracking-allocator/src/lib.rs +++ b/polkadot/node/tracking-allocator/src/lib.rs @@ -90,7 +90,7 @@ impl TrackingAllocatorData { if self.current > self.peak { self.peak = self.current; } - let within_limits = self.limit == 0 || self.peak <= self.limit; + let within_limits = self.peak <= self.limit; if within_limits { self.unlock() } @@ -122,7 +122,7 @@ impl TrackingAllocator { limit: Option, failure_handler: Option>, ) { - ALLOCATOR_DATA.start_tracking(limit.unwrap_or(0), failure_handler); + ALLOCATOR_DATA.start_tracking(limit.unwrap_or(isize::MAX), failure_handler); } /// End tracking and return the peak allocation value in bytes (as `isize`). Peak allocation