From af6e349f6740598f02836d3bdd729301495f90bc Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Thu, 30 Jun 2016 15:11:41 -0700 Subject: [PATCH] Don't reuse variable names This code was rather hard to follow due to reusing the same variable multiple times. Lets give them unique names. Change-Id: I8f134b6314d593a3e40b19765c7b71496b8e524d --- includes/api/ApiQuerySearch.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 80798a10cd..f84f806b1f 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -231,16 +231,16 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $hasInterwikiResults = false; $totalhits = null; if ( $interwiki && $resultPageSet === null && $matches->hasInterwikiResults() ) { - foreach ( $matches->getInterwikiResults() as $matches ) { - $matches = $matches->getInterwikiResults(); + foreach ( $matches->getInterwikiResults() as $interwikiMatches ) { + $currentMatches = $interwikiMatches->getInterwikiResults(); $hasInterwikiResults = true; // Include number of results if requested if ( $resultPageSet === null && isset( $searchInfo['totalhits'] ) ) { - $totalhits += $matches->getTotalHits(); + $totalhits += $currentMatches->getTotalHits(); } - $result = $matches->next(); + $result = $currentMatches->next(); while ( $result ) { $title = $result->getTitle(); @@ -267,7 +267,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $titles[] = $title; } - $result = $matches->next(); + $result = $currentMatches->next(); } } if ( $totalhits !== null ) { -- 2.20.1