Thread (4 messages) 4 messages, 2 authors, 2024-09-02

Re: [PATCH RESEND] block, rust: simplify validate_block_size() function

From: Benno Lossin <hidden>
Date: 2024-08-31 20:39:51
Also in: rust-for-linux

On 31.08.24 22:15, Alexey Dobriyan wrote:
Using range and contains() method is just fancy shmancy way of writing
This language doesn't fit into a commit message. Please give a technical
reason to change this.
two comparisons. Using range doesn't prevent any bugs here because
typing "=" in range can be forgotten just as easily as in "<=" operator.
I don't think that using traditional comparisons is an improvement. When
using `contains`, both of the bounds are visible with one look. When
using two comparisons, you have to first parse that they compare the
same variable and then look at the bounds.
Also delete few comments of "increment i by 1" variety.
As Miguel already said, these are part of the documentation. Do not
remove them.

---
Cheers,
Benno
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help