mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Add cast to unsigned to improve div by 2 in find_internal_func()
This commit is contained in:
parent
db23cb05d1
commit
3f38c384ef
@ -7155,15 +7155,13 @@ find_internal_func (
|
||||
{
|
||||
int first = 0;
|
||||
int last = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
|
||||
int cmp;
|
||||
int x;
|
||||
|
||||
/*
|
||||
* Find the function name in the table. Binary search.
|
||||
*/
|
||||
while (first <= last) {
|
||||
x = first + (last - first) / 2;
|
||||
cmp = STRCMP(name, functions[x].f_name);
|
||||
int x = first + ((unsigned)(last - first)) / 2;
|
||||
int cmp = STRCMP(name, functions[x].f_name);
|
||||
if (cmp < 0)
|
||||
last = x - 1;
|
||||
else if (cmp > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user