jenkins-bot has submitted this change and it was merged.

Change subject: Fix: Warning: Division by zero in 
includes/BuildDocument/SuggestScoring.php on line 188
......................................................................


Fix: Warning: Division by zero in includes/BuildDocument/SuggestScoring.php on 
line 188

Change-Id: Ie011f55213fc3bde910e124526d93751be9afe9d
---
M includes/BuildDocument/SuggestScoring.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/BuildDocument/SuggestScoring.php 
b/includes/BuildDocument/SuggestScoring.php
index 5049554..edfd649 100644
--- a/includes/BuildDocument/SuggestScoring.php
+++ b/includes/BuildDocument/SuggestScoring.php
@@ -144,10 +144,6 @@
         */
        public function __construct( $boostTemplates = null ) {
                $this->boostTemplates = $boostTemplates ?: 
Util::getDefaultBoostTemplates();
-               if ( $this->incomingLinksNorm < 1 ) {
-                       // it's a very small wiki let's force the norm to 1
-                       $this->incomingLinksNorm = 1;
-               }
        }
 
        /**
@@ -267,6 +263,10 @@
                $this->maxDocs = $maxDocs;
                // We normalize incoming links according to the size of the 
index
                $this->incomingLinksNorm = (int) ($maxDocs * 
self::INCOMING_LINKS_MAX_DOCS_FACTOR);
+               if ( $this->incomingLinksNorm < 1 ) {
+                       // it's a very small wiki let's force the norm to 1
+                       $this->incomingLinksNorm = 1;
+               }
        }
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie011f55213fc3bde910e124526d93751be9afe9d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to