[FileBackend] Optimize the case were no operations are provided.
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 10 May 2013 20:45:34 +0000 (13:45 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 10 May 2013 20:45:34 +0000 (13:45 -0700)
Change-Id: Iaf858ce2e8b21e031d27b984029f0424518201af

includes/filebackend/FileBackendStore.php

index e20c6fc..c620dd3 100644 (file)
@@ -1134,6 +1134,10 @@ 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 );
 
@@ -1186,6 +1190,10 @@ 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 );