From: Aaron Schulz Date: Thu, 8 Jun 2017 14:49:28 +0000 (-0700) Subject: objectcache: Use faster getArrayCopy() in WAN cache methods X-Git-Tag: 1.31.0-rc.0~3019^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=914274c58cee32fe2394f785c494b319c1f3a6cf;p=lhc%2Fweb%2Fwiklou.git objectcache: Use faster getArrayCopy() in WAN cache methods Change-Id: I5f0543a59bdc59656c54fab4d7c4ae33fd233f9a --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 423d43eff9..58e4e091ae 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -1109,7 +1109,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { final public function getMultiWithSetCallback( ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = [] ) { - $valueKeys = array_keys( iterator_to_array( $keyedIds, true ) ); + $valueKeys = array_keys( $keyedIds->getArrayCopy() ); $checkKeys = isset( $opts['checkKeys'] ) ? $opts['checkKeys'] : []; // Load required keys into process cache in one go @@ -1195,7 +1195,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { final public function getMultiWithUnionSetCallback( ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = [] ) { - $idsByValueKey = iterator_to_array( $keyedIds, true ); + $idsByValueKey = $keyedIds->getArrayCopy(); $valueKeys = array_keys( $idsByValueKey ); $checkKeys = isset( $opts['checkKeys'] ) ? $opts['checkKeys'] : []; unset( $opts['lockTSE'] ); // incompatible