Re: [PATCH v2] lib: One less subtraction in binary search iterations.

2013-07-14 Thread Rusty Russell
Wedson Almeida Filho writes: > The subtraction is removed at the expense of generality: when the element size > is 1, the array length cannot exceed half the architecture's addressable > memory. People do copy code, so I prefer to set the best example possible. Unless it's a useful optimization,

[PATCH v2] lib: One less subtraction in binary search iterations.

2013-07-08 Thread Wedson Almeida Filho
The subtraction is removed at the expense of generality: when the element size is 1, the array length cannot exceed half the architecture's addressable memory. Signed-off-by: Wedson Almeida Filho --- lib/bsearch.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/b