objectcache: refactor and simplify some WANObjectCache code
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Feb 2019 20:24:27 +0000 (12:24 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 14 Feb 2019 03:48:44 +0000 (19:48 -0800)
commit999ff6097dd82355a8ddd36d6a777e933bb7a35d
tree0c0afe4cce0d85bd6481ccbee3b2928bdaa73de5
parentdc24eba870a2f218583b82aa01a11e3129477d44
objectcache: refactor and simplify some WANObjectCache code

* Move $value === false checks to isValid()
* Rename $isTombstone variable to avoid confusion with the new value
* Reorganize conditionals around set() calls in doGetWithSetCallback()
* Skip getInterimValue() check when there is no reason to assume anything
  might even be there (e.g. the key is not tombstoned)
* Fold the tombstone case for $useMutex into the ternary

Change-Id: I257110097cffe7fe87c6a9896e875f09d5c936d9
includes/libs/objectcache/WANObjectCache.php