Skip to content

Commit

Permalink
Eliminate redundant branch
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Sep 28, 2023
1 parent 73799fb commit 93b9d61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polkadot/node/tracking-allocator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -122,7 +122,7 @@ impl<A: GlobalAlloc> TrackingAllocator<A> {
limit: Option<isize>,
failure_handler: Option<Box<dyn Fn()>>,
) {
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
Expand Down

0 comments on commit 93b9d61

Please sign in to comment.