From 914274c58cee32fe2394f785c494b319c1f3a6cf Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 8 Jun 2017 07:49:28 -0700 Subject: [PATCH] objectcache: Use faster getArrayCopy() in WAN cache methods Change-Id: I5f0543a59bdc59656c54fab4d7c4ae33fd233f9a --- includes/libs/objectcache/WANObjectCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.20.1