• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Unnecessary Call of getAllPrefixesGroupedByRouteType in XenForo_Model_RoutePrefix



You're calling $this->getAllPrefixesGroupedByRouteType in method importPrefixesAddOnXml, which will run 2 queries.
(they aren't big for avarage joe and probably they're cached by sql server because you run them ~10 lines later again, BUT

That's IMHO not necessary, because you don't do anything with the result, so you could remove this part...

    * Imports the add-on route prefixes XML.
    * @param SimpleXMLElement $xml XML element pointing to the root of the prefix data
    * @param string $addOnId Add-on to import for
    public function importPrefixesAddOnXml(SimpleXMLElement $xml, $addOnId)
        $db = $this->_getDb();

        $currentPrefixes = $this->getAllPrefixesGroupedByRouteType(); // unnecessary part!!!*****************************************


        $routeTypes = XenForo_Helper_DevelopmentXml::fixPhpBug50670($xml->route_type);
        foreach ($routeTypes AS $typeXml)