Skip to content

Commit

Permalink
Replace unneeded wrapping_neg() by negation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Feb 25, 2022
1 parent edbc30f commit 26d1ac0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions contracts/tg4-mixer/src/member_indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ impl<'a> IndexList<MemberInfo> for MemberIndexes<'a> {
pub fn members<'a>() -> IndexedSnapshotMap<'a, &'a Addr, MemberInfo, MemberIndexes<'a>> {
let indexes = MemberIndexes {
points_tie_break: MultiIndex::new(
|mi| {
(
mi.points,
mi.start_height
.map_or(i64::MIN, |h| (h as i64).wrapping_neg()),
)
}, // Works as long as `start_height <= i64::MAX + 1`
|mi| (mi.points, mi.start_height.map_or(i64::MIN, |h| -(h as i64))), // Works as long as `start_height <= i64::MAX + 1`
tg4::MEMBERS_KEY,
"members__points_tie_break",
),
Expand Down

0 comments on commit 26d1ac0

Please sign in to comment.