Skip to content

Commit 9dff177

Browse files
committed
MAGE-1383 Experiment with imperative for loop
1 parent 4a283d4 commit 9dff177

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Helper/ArrayDeduplicator.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@ public function dedupeArrayOfArrays(array $data): array {
4747
// );
4848

4949
// Experiment 2
50+
// $decoded = [];
51+
// array_walk($unique, function($item) use (&$decoded) {
52+
// $decoded[] = json_decode((string) $item, true);
53+
// });
54+
55+
// Experiment 3
5056
$decoded = [];
51-
array_walk($unique, function($item) use (&$decoded) {
57+
foreach ($unique as $item) {
5258
$decoded[] = json_decode((string) $item, true);
53-
});
59+
}
5460

5561
return $decoded;
5662
}

0 commit comments

Comments
 (0)