While reviewing the code I was a confused by the name num_entries which suggest an integer while actually a fractional number is used. Changing this to usize and shadowingnum_items locally makes the function call 7 machine code instructions shorter and the function body longer 5 instructions longer (from 65 to 70, as checked by the compiler explorer). So with improved code readability also 2 instructions less are needed.
While reviewing the code I was a confused by the name num_entries which suggest an integer while actually a fractional number is used. Changing this to usize and shadowing
num_items
locally makes the function call 7 machine code instructions shorter and the function body longer 5 instructions longer (from 65 to 70, as checked by the compiler explorer). So with improved code readability also 2 instructions less are needed.