From 53db056c0fa24c1c8539a36002a3009f6a15bfa1 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 3 Oct 2022 13:01:30 +0200 Subject: Revert "Fix it::map with generators: Avoid iterating over generator twice" This reverts commit 6d488d7acdacfa8ac477da0afe5175ef9d98dfbe. --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it.class') diff --git a/it.class b/it.class index c7d43cb..2079e84 100644 --- a/it.class +++ b/it.class @@ -1111,7 +1111,7 @@ static function map($code, $array, $p = null) { $func = self::createfunc($code); $result = is_array($array) ? $array : iterator_to_array($array); - foreach (isset($p['keys']) ? it::filter_keys($result, $p['keys']) : $result as $k => $v) + foreach (isset($p['keys']) ? it::filter_keys($array, $p['keys']) : $array as $k => $v) $result[$k] = $func($k, $v); return (array)$result; -- cgit v1.2.3