Merge pull request #7868 from maxela/patch-2

Optimized function 'mp'
This commit is contained in:
Theo Arends 2020-03-07 19:03:18 +01:00 committed by GitHub
commit 4094b069d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 14 deletions

View File

@ -1502,30 +1502,27 @@ chknext:
lp=GetNumericResult(lp,OPER_EQU,&fvar1,0); lp=GetNumericResult(lp,OPER_EQU,&fvar1,0);
SCRIPT_SKIP_SPACES SCRIPT_SKIP_SPACES
while (*lp!=')') { while (*lp!=')') {
char str[SCRIPT_MAXSSIZE]; char *opp=lp;
lp=GetStringResult(lp,OPER_EQU,str,0); lp++;
SCRIPT_SKIP_SPACES
char *pstr=str;
pstr++;
float fvar2; float fvar2;
pstr=GetNumericResult(pstr,OPER_EQU,&fvar2,0); lp=GetNumericResult(lp,OPER_EQU,&fvar2,0);
while (*pstr==' ') pstr++; SCRIPT_SKIP_SPACES
fvar=fvar1; fvar=fvar1;
if ((str[0]=='<' && fvar1<fvar2) || if ((*opp=='<' && fvar1<fvar2) ||
(str[0]=='>' && fvar1>fvar2) || (*opp=='>' && fvar1>fvar2) ||
(str[0]=='=' && fvar1==fvar2)) (*opp=='=' && fvar1==fvar2))
{ {
if (*pstr==':') { if (*lp!='<' && *lp!='>' && *lp!='=' && *lp!=')' && *lp!=SCRIPT_EOL) {
pstr++;
while (*pstr==' ') pstr++;
float fvar3; float fvar3;
pstr=GetNumericResult(pstr,OPER_EQU,&fvar3,0); lp=GetNumericResult(lp,OPER_EQU,&fvar3,0);
SCRIPT_SKIP_SPACES
fvar=fvar3; fvar=fvar3;
} else { } else {
fvar=fvar2; fvar=fvar2;
} }
break; break;
} }
while (*lp!='<' && *lp!='>' && *lp!='=' && *lp!=')' && *lp!=SCRIPT_EOL) lp++;
} }
len=0; len=0;
goto exit; goto exit;