From 6b1194b9dadeff80b51d6af7c56c97244a92a058 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 10 May 2013 13:45:34 -0700 Subject: [PATCH] [FileBackend] Optimize the case were no operations are provided. Change-Id: Iaf858ce2e8b21e031d27b984029f0424518201af --- includes/filebackend/FileBackendStore.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index e20c6fcc5c..c620dd3be8 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -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 ); -- 2.20.1