Fixed bug #13675: Performance improvement: Use array_walk() for t3lib_div::intExplode
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Feb 2010 16:08:52 +0000 (16:08 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Feb 2010 16:08:52 +0000 (16:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7053 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index d7d9d29..bd5e065 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-26  Christian Kuhn  <lolli@schwarzbu.ch>
+
+       * Fixed bug #13675: Performance improvement: Use array_walk() for t3lib_div::intExplode (Thanks to Georg Ringer)
+
 2010-02-26  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #13262: replace hardcoded typo3/ with TYPO3_mainDir (Thanks to Georg Ringer)
index 55ddca5..6cf9624 100644 (file)
@@ -1648,13 +1648,10 @@ final class t3lib_div {
         *                                              if zero (default), the result is not limited at all
         * @return      array           Exploded values, all converted to integers
         */
-       public static function intExplode($delim, $string, $onlyNonEmptyValues = false, $limit = 0)     {
-               $temp = self::trimExplode($delim, $string, $onlyNonEmptyValues, $limit);
-               foreach ($temp as &$val) {
-                       $val = intval($val);
-               }
-               reset($temp);
-               return $temp;
+       public static function intExplode($delimiter, $string, $onlyNonEmptyValues = FALSE, $limit = 0) {
+               $explodedValues = self::trimExplode($delimiter, $string, $onlyNonEmptyValues, $limit);
+               array_walk($explodedValues, 'intval');
+               return $explodedValues;
        }
 
        /**