Improve performance: arrange methods by call probability

* checked this with: EnWikiFormulaeTest.php
* remove finding chem macro from BaseMethods::checkAndParse, because
  this will be used somewhere else
* minor: remove mi from mathFont parsing function

Bug: T321599
Change-Id: I472e3ebdebfc91f97c9391268a384f788571612e
This commit is contained in:
Stegmujo 2023-03-28 11:31:55 +00:00 committed by Physikerwelt
parent 5de6683c05
commit 9213f93b88
2 changed files with 3 additions and 7 deletions

View file

@ -38,14 +38,11 @@ class BaseMethods {
// probably refactored later
$resFct = AMSMappings::getEnvironmentByKey( $input );
if ( $resFct == null ) {
$resFct = BaseMappings::getcancelByKey( $input );
$resFct = BaseMappings::getCustomByKey( $input );
if ( $resFct == null ) {
$resFct = BaseMappings::getCustomByKey( $input );
$resFct = BaseMappings::getSpecialByKey( $input );
if ( $resFct == null ) {
$resFct = BaseMappings::getSpecialByKey( $input );
if ( $resFct == null ) {
$resFct = BaseMappings::getMhChemByKey( $input );
}
$resFct = BaseMappings::getCancelByKey( $input );
}
}
}

View file

@ -666,7 +666,6 @@ class BaseParsing {
public static function mathFont( $node, $passedArgs, $operatorContent, $name, $mathvariant = null ) {
$mrow = new MMLmrow( TexClass::ORD, [] );
$mi = new MMLmi();
$args = MMLParsingUtil::getFontArgs( $name, $mathvariant, $passedArgs );
if ( $node instanceof Fun1nb ) {