Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: idiomatic math operations #591

Merged
merged 1 commit into from
Sep 1, 2022
Merged

fix: idiomatic math operations #591

merged 1 commit into from
Sep 1, 2022

Conversation

Stebalien
Copy link
Member

  • prefer is_positive/negative/zero over comparisons with TokenAmount::zero (saves an allocation).
  • Prefer div_floor over div_rem

- prefer is_positive/negative/zero over comparisons with
  TokenAmount::zero (saves an allocation).
- Prefer div_floor over div_rem
@codecov-commenter
Copy link

Codecov Report

Merging #591 (70d69a2) into master (b7ad2c5) will increase coverage by 0.12%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #591      +/-   ##
==========================================
+ Coverage   83.92%   84.04%   +0.12%     
==========================================
  Files          88       88              
  Lines       18155    18155              
==========================================
+ Hits        15236    15258      +22     
+ Misses       2919     2897      -22     
Impacted Files Coverage Δ
actors/reward/src/state.rs 81.08% <0.00%> (ø)
actors/reward/src/lib.rs 82.92% <100.00%> (ø)
actors/cron/src/lib.rs 93.10% <0.00%> (-3.45%) ⬇️
actors/miner/src/lib.rs 80.53% <0.00%> (+0.05%) ⬆️
actors/verifreg/src/lib.rs 72.85% <0.00%> (+0.15%) ⬆️
test_vm/src/lib.rs 88.85% <0.00%> (+0.46%) ⬆️
runtime/src/util/message_accumulator.rs 94.54% <0.00%> (+0.90%) ⬆️
actors/miner/src/deadline_info.rs 96.62% <0.00%> (+16.85%) ⬆️

@Stebalien Stebalien requested a review from anorth September 1, 2022 00:16
@anorth anorth merged commit bacf044 into master Sep 1, 2022
@anorth anorth deleted the fix/idiomatic-math branch September 1, 2022 01:38
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants