From 64e3ce6a11a1eb860d14b8e7039adc6411c1f721 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 2 Jan 2012 14:20:16 +0100 Subject: [PATCH] simplified code --- lib/Twig/Extension/Core.php | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index a042c37..8ca4c8e 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -489,11 +489,7 @@ function twig_array_merge($arr1, $arr2) function twig_join_filter($value, $glue = '') { if ($value instanceof Traversable) { - $values = array(); - foreach ($value as $v) { - $values[] = $v; - } - $value = $values; + $value = iterator_to_array($value); } return implode($glue, (array) $value); -- 1.7.2.5