Skip to content

Commit

Permalink
token bucket: Add parens to rate_per_sec_to_rate_per_step()
Browse files Browse the repository at this point in the history
Typecasts bind more tightly than division, so we need to do the
division first.
  • Loading branch information
nmathewson committed Apr 17, 2018
1 parent 002c5ca commit 2bf6f1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/token_bucket.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ rate_per_sec_to_rate_per_step(uint32_t rate)
*/
uint64_t units = (uint64_t) rate * TICKS_PER_STEP;
uint32_t val = (uint32_t)
monotime_coarse_stamp_units_to_approx_msec(units) / 1000;
(monotime_coarse_stamp_units_to_approx_msec(units) / 1000);
return val ? val : 1;
}

Expand Down

0 comments on commit 2bf6f1c

Please sign in to comment.