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

Change subject: Simplify the nested ifs of Preprocessor_DOM::preprocessToObj()
......................................................................


Simplify the nested ifs of Preprocessor_DOM::preprocessToObj()

Change-Id: Ibb91068678aca1729f00f1ba7844017771334e94
---
M includes/parser/Preprocessor_DOM.php
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  IAlex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/parser/Preprocessor_DOM.php 
b/includes/parser/Preprocessor_DOM.php
index 4ea7dd4..809e7f7 100644
--- a/includes/parser/Preprocessor_DOM.php
+++ b/includes/parser/Preprocessor_DOM.php
@@ -148,21 +148,19 @@
                                        wfDebugLog( "Preprocessor", "Loaded 
preprocessor XML from memcached (key $cacheKey)" );
                                }
                        }
-               }
-               if ( $xml === false ) {
-                       if ( $cacheable ) {
+                       if ( $xml === false ) {
                                wfProfileIn( __METHOD__ . '-cache-miss' );
                                $xml = $this->preprocessToXml( $text, $flags );
                                $cacheValue = sprintf( "%08d", 
self::CACHE_VERSION ) . $xml;
                                $wgMemc->set( $cacheKey, $cacheValue, 86400 );
                                wfProfileOut( __METHOD__ . '-cache-miss' );
                                wfDebugLog( "Preprocessor", "Saved preprocessor 
XML to memcached (key $cacheKey)" );
-                       } else {
-                               $xml = $this->preprocessToXml( $text, $flags );
                        }
-
+               } else {
+                       $xml = $this->preprocessToXml( $text, $flags );
                }
 
+
                // Fail if the number of elements exceeds acceptable limits
                // Do not attempt to generate the DOM
                $this->parser->mGeneratedPPNodeCount += substr_count( $xml, '<' 
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb91068678aca1729f00f1ba7844017771334e94
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Platonides <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to