Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
not needed
  • Loading branch information
shawntabrizi committed Sep 1, 2022
commit 720de4c13e94efe7ed3baca60368f76bd8cbe47d
4 changes: 1 addition & 3 deletions frame/support/src/weights/weight_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ impl Weight {

/// Increment [`Weight`] by `amount` via saturating addition.
pub fn saturating_accrue(&mut self, amount: Self) {
let mut o = Self::zero();
sp_std::mem::swap(&mut o, self);
*self = o.saturating_add(amount);
*self = self.saturating_add(amount);
}

/// Checked [`Weight`] addition. Computes `self + rhs`, returning `None` if overflow occurred.
Expand Down