Commit c06c5cc
committed
Replace multiplication with shift
Since the multiplier is a power-of-two, we should avoid relying on the
compiler noticing that and perform the optimization directly. Of course,
the JIT does realize this in C2, but ideally we don't write code making
those assumptions as easy to regress.1 parent 2ce49a4 commit c06c5cc
File tree
2 files changed
+8
-1
lines changed- caffeine/src
- jmh/java/com/github/benmanes/caffeine/cache
- main/java/com/github/benmanes/caffeine/cache
2 files changed
+8
-1
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
250 | | - | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| |||
0 commit comments