Skip to content

Commit

Permalink
Improve is_empty() check
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Sep 14, 2020
1 parent 5b7094d commit 7e2373d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cw0/src/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Balance {
}

pub fn is_empty(&self) -> bool {
self.0.is_empty()
!self.0.iter().any(|x| x.amount != 0)
}

/// similar to `Balance.sub`, but doesn't fail when minuend less than subtrahend
Expand Down

0 comments on commit 7e2373d

Please sign in to comment.