objectcache: remove some unneeded code from BagOStuff::mergeViaCas
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 28 Mar 2019 02:11:17 +0000 (19:11 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 28 Mar 2019 02:33:07 +0000 (19:33 -0700)
Change-Id: Ib92090fe4e1b1eb2c4f9e031f8476b24189392c8

includes/libs/objectcache/BagOStuff.php

index 5669366..0dd7b57 100644 (file)
@@ -288,13 +288,10 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         */
        protected function mergeViaCas( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
                do {
-                       $this->clearLastError();
-                       $reportDupes = $this->reportDupes;
-                       $this->reportDupes = false;
                        $casToken = null; // passed by reference
+                       // Get the old value and CAS token from cache
+                       $this->clearLastError();
                        $currentValue = $this->doGet( $key, self::READ_LATEST, $casToken );
-                       $this->reportDupes = $reportDupes;
-
                        if ( $this->getLastError() ) {
                                $this->logger->warning(
                                        __METHOD__ . ' failed due to I/O error on get() for {key}.',