Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230043

Change subject: Remove not needed nesting
......................................................................

Remove not needed nesting

Change-Id: Ib5d64393964631e070fd6d8b1cbc2f767c0d85ef
---
M client/includes/DataAccess/PropertyParserFunction/Runner.php
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/43/230043/1

diff --git a/client/includes/DataAccess/PropertyParserFunction/Runner.php 
b/client/includes/DataAccess/PropertyParserFunction/Runner.php
index ca50e1c..e3ec1d7 100644
--- a/client/includes/DataAccess/PropertyParserFunction/Runner.php
+++ b/client/includes/DataAccess/PropertyParserFunction/Runner.php
@@ -135,24 +135,24 @@
         * Gets the entity and increments the expensive parser function count.
         *
         * @param Parser $parser
-        * @param string $from
+        * @param string $entityIdString
         *
         * @return EntityId|null
         */
-       private function getEntityIdFromString( Parser $parser, $from ) {
+       private function getEntityIdFromString( Parser $parser, $entityIdString 
) {
                try {
-                       $entityId = $this->entityIdParser->parse( $from );
-
-                       // Getting a foreign item is expensive (unless we 
already loaded it and it's cached)
-                       if ( 
!$this->restrictedEntityLookup->hasEntityBeenAccessed( $entityId ) ) {
-                               $parser->incrementExpensiveFunctionCount();
-                       }
-
-                       return $entityId;
+                       $entityId = $this->entityIdParser->parse( 
$entityIdString );
                } catch ( EntityIdParsingException $ex ) {
                        // Just ignore this
                        return null;
                }
+
+               // Getting a foreign item is expensive (unless we already 
loaded it and it's cached)
+               if ( !$this->restrictedEntityLookup->hasEntityBeenAccessed( 
$entityId ) ) {
+                       $parser->incrementExpensiveFunctionCount();
+               }
+
+               return $entityId;
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/230043
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5d64393964631e070fd6d8b1cbc2f767c0d85ef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to