Merge "objectcache: minor fix to MultiWriteBagOStuff::doWrite()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 17 Jul 2018 01:00:06 +0000 (01:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 17 Jul 2018 01:00:06 +0000 (01:00 +0000)
includes/libs/objectcache/MultiWriteBagOStuff.php

index 64bfa95..91f4167 100644 (file)
@@ -202,7 +202,7 @@ class MultiWriteBagOStuff extends BagOStuff {
                $ret = true;
                $args = array_slice( func_get_args(), 3 );
 
-               if ( count( $indexes ) > 1 && $asyncWrites ) {
+               if ( array_diff( $indexes, [ 0 ] ) && $asyncWrites ) {
                        // Deep-clone $args to prevent misbehavior when something writes an
                        // object to the BagOStuff then modifies it afterwards, e.g. T168040.
                        $args = unserialize( serialize( $args ) );