mirror of
https://https.git.savannah.gnu.org/git/diffutils.git
synced 2026-01-27 09:54:25 +00:00
diff: calculate log2 faster in io.c
* src/io.c (find_identical_ends): Use floor_log2 instead of computing log base 2 by hand.
This commit is contained in:
parent
c41d3d921e
commit
e8a7dab95c
3
src/io.c
3
src/io.c
@ -667,8 +667,7 @@ find_identical_ends (struct file_data filevec[])
|
||||
{
|
||||
middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end);
|
||||
lin suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0);
|
||||
for (prefix_count = 1; prefix_count <= context; prefix_count *= 2)
|
||||
continue;
|
||||
prefix_count = (lin) 1 << (floor_log2 (context) + 1);
|
||||
alloc_lines0 = (prefix_count + middle_guess
|
||||
+ MIN (context, suffix_guess));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user