From: Aaron Schulz Date: Fri, 10 May 2013 20:55:39 +0000 (-0700) Subject: [FileBackend] Moved short-circuit check from 6b1194b9 up to FileBackend. X-Git-Tag: 1.31.0-rc.0~19709^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=b14212992d861766eb7d6b3c919c118dbe92e724;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Moved short-circuit check from 6b1194b9 up to FileBackend. Change-Id: I57566a1779f353c18d96c59c47112c753aea6b90 --- diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 0c9f7a17b2..ab30d3050d 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -314,6 +314,9 @@ abstract class FileBackend { 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 @@ abstract class FileBackend { 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 c620dd3be8..e20c6fcc5c 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -1134,10 +1134,6 @@ abstract class FileBackendStore extends FileBackend { 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 ); @@ -1190,10 +1186,6 @@ abstract class FileBackendStore extends FileBackend { 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 );