Commit bd7ab996 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Переделал проверку isOperator. Убрал использование RegEx для этого. Ускорение...

Переделал проверку isOperator. Убрал использование RegEx для этого. Ускорение на 65000 операциях с 150мс на 20.
parent 3ce2850e
......@@ -4118,7 +4118,7 @@ parserFormula.prototype = {
}*/
/* Operators*/
if ( parserHelp.isOperator.call( this, this.Formula, this.pCurrPos ) || parserHelp.isNextPtg.call( this, this.Formula, this.pCurrPos ) ) {
if (parserHelp.isOperator.call(this, this.Formula, this.pCurrPos) || parserHelp.isNextPtg.call(this, this.Formula, this.pCurrPos)) {
wasLeftParentheses = false;
wasRigthParentheses = false;
found_operator = null;
......@@ -4350,7 +4350,7 @@ parserFormula.prototype = {
arr.addElement( new cNumber( parseFloat( this.operand_str ) ) );
operator = { isOperator: false, operatorName: ""};
}
else if ( parserHelp.isOperator.call( this, this.Formula, this.pCurrPos ) ) {
else if (parserHelp.isOperator.call(this, this.Formula, this.pCurrPos)) {
operator.isOperator = true;
operator.operatorName = this.operand_str;
}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment