Aaron Schulz has uploaded a new change for review.

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


Change subject: [FileBackend] Moved short-circuit check from 6b1194b9 up to 
FileBackend.
......................................................................

[FileBackend] Moved short-circuit check from 6b1194b9 up to FileBackend.

Change-Id: I57566a1779f353c18d96c59c47112c753aea6b90
---
M includes/filebackend/FileBackend.php
M includes/filebackend/FileBackendStore.php
2 files changed, 6 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/63224/1

diff --git a/includes/filebackend/FileBackend.php 
b/includes/filebackend/FileBackend.php
index 0c9f7a1..ab30d30 100644
--- a/includes/filebackend/FileBackend.php
+++ b/includes/filebackend/FileBackend.php
@@ -314,6 +314,9 @@
                if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', 
$this->name, $this->readOnly );
                }
+               if ( !count( $ops ) ) {
+                       return Status::newGood(); // nothing to do
+               }
                if ( empty( $opts['force'] ) ) { // sanity
                        unset( $opts['nonLocking'] );
                }
@@ -545,6 +548,9 @@
                if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', 
$this->name, $this->readOnly );
                }
+               if ( !count( $ops ) ) {
+                       return Status::newGood(); // nothing to do
+               }
                foreach ( $ops as &$op ) {
                        $op['overwrite'] = true; // avoids RTTs in key/value 
stores
                        if ( isset( $op['disposition'] ) ) { // b/c (MW 1.20)
diff --git a/includes/filebackend/FileBackendStore.php 
b/includes/filebackend/FileBackendStore.php
index c620dd3..e20c6fc 100644
--- a/includes/filebackend/FileBackendStore.php
+++ b/includes/filebackend/FileBackendStore.php
@@ -1134,10 +1134,6 @@
                wfProfileIn( __METHOD__ . '-' . $this->name );
                $status = Status::newGood();
 
-               if ( !count( $ops ) ) {
-                       return $status; // nothing to do
-               }
-
                // Fix up custom header name/value pairs...
                $ops = array_map( array( $this, 'stripInvalidHeadersFromOp' ), 
$ops );
 
@@ -1189,10 +1185,6 @@
                wfProfileIn( __METHOD__ );
                wfProfileIn( __METHOD__ . '-' . $this->name );
                $status = Status::newGood();
-
-               if ( !count( $ops ) ) {
-                       return $status; // nothing to do
-               }
 
                // Fix up custom header name/value pairs...
                $ops = array_map( array( $this, 'stripInvalidHeadersFromOp' ), 
$ops );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57566a1779f353c18d96c59c47112c753aea6b90
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to