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 = { ...@@ -4118,7 +4118,7 @@ parserFormula.prototype = {
}*/ }*/
/* Operators*/ /* 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; wasLeftParentheses = false;
wasRigthParentheses = false; wasRigthParentheses = false;
found_operator = null; found_operator = null;
...@@ -4350,7 +4350,7 @@ parserFormula.prototype = { ...@@ -4350,7 +4350,7 @@ parserFormula.prototype = {
arr.addElement( new cNumber( parseFloat( this.operand_str ) ) ); arr.addElement( new cNumber( parseFloat( this.operand_str ) ) );
operator = { isOperator: false, operatorName: ""}; 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.isOperator = true;
operator.operatorName = this.operand_str; 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