mirror of
https://github.com/rfivet/uemacs.git
synced 2025-01-05 07:46:58 -05:00
Review function name table search in eval.c:gtfun.
This commit is contained in:
parent
c10b525fb5
commit
84bf4de212
6
eval.c
6
eval.c
@ -324,10 +324,10 @@ static char *gtfun( char *fname) {
|
|||||||
fnum = ARRAY_SIZE( funcs) ;
|
fnum = ARRAY_SIZE( funcs) ;
|
||||||
low = 0 ;
|
low = 0 ;
|
||||||
high = fnum - 1 ;
|
high = fnum - 1 ;
|
||||||
while( low <= high) {
|
do {
|
||||||
int s, cur ;
|
int s, cur ;
|
||||||
|
|
||||||
cur = (high - low + 1) / 2 + low ;
|
cur = (high + low) / 2 ;
|
||||||
s = strcmp( fname, funcs[ cur].f_name) ;
|
s = strcmp( fname, funcs[ cur].f_name) ;
|
||||||
if( s == 0) {
|
if( s == 0) {
|
||||||
fnum = cur ;
|
fnum = cur ;
|
||||||
@ -336,7 +336,7 @@ static char *gtfun( char *fname) {
|
|||||||
high = cur - 1 ;
|
high = cur - 1 ;
|
||||||
else
|
else
|
||||||
low = cur + 1 ;
|
low = cur + 1 ;
|
||||||
}
|
} while( low <= high) ;
|
||||||
|
|
||||||
/* return errorm on a bad reference */
|
/* return errorm on a bad reference */
|
||||||
if (fnum == ARRAY_SIZE(funcs))
|
if (fnum == ARRAY_SIZE(funcs))
|
||||||
|
Loading…
Reference in New Issue
Block a user