mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove redundant if statement in try_move
The if statement is redundant since if `index == 0` then `BITS_BITLENGTH * index == 0`.
This commit is contained in:
parent
e3b5cc8836
commit
b07879e553
Notes:
git
2022-01-25 23:38:45 +09:00
1 changed files with 1 additions and 6 deletions
7
gc.c
7
gc.c
|
@ -4959,12 +4959,7 @@ try_move(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_page,
|
||||||
bits >>= NUM_IN_PAGE(p) % BITS_BITLENGTH;
|
bits >>= NUM_IN_PAGE(p) % BITS_BITLENGTH;
|
||||||
if (try_move_plane(objspace, heap, sweep_page, (uintptr_t)p, bits, dest)) return 1;
|
if (try_move_plane(objspace, heap, sweep_page, (uintptr_t)p, bits, dest)) return 1;
|
||||||
|
|
||||||
if (index == 0) {
|
p = cursor->start + (BITS_BITLENGTH - NUM_IN_PAGE(cursor->start)) + (BITS_BITLENGTH * index);
|
||||||
p = cursor->start + (BITS_BITLENGTH - NUM_IN_PAGE(cursor->start));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
p = cursor->start + (BITS_BITLENGTH - NUM_IN_PAGE(cursor->start)) + (BITS_BITLENGTH * index);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find an object to move and move it. Movable objects must be
|
/* Find an object to move and move it. Movable objects must be
|
||||||
* marked, so we iterate using the marking bitmap */
|
* marked, so we iterate using the marking bitmap */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue