From cfd6d3cd5a44bb702b787dc2db144f4246e0c001 Mon Sep 17 00:00:00 2001 From: acidvertigo Date: Thu, 18 Aug 2011 21:14:44 +0300 Subject: [PATCH] Running the explode instruction outside the foreach loops is faster --- min/lib/Minify/Controller/MinApp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/min/lib/Minify/Controller/MinApp.php b/min/lib/Minify/Controller/MinApp.php index 986ef2c..3522f8c 100644 --- a/min/lib/Minify/Controller/MinApp.php +++ b/min/lib/Minify/Controller/MinApp.php @@ -45,7 +45,8 @@ class Minify_Controller_MinApp extends Minify_Controller_Base { $this->log("Duplicate group key found."); return $options; } - foreach (explode(',', $_GET['g']) as $key) { + $keys = explode(',', $_GET['g']); + foreach ($keys as $key) { if (! isset($cOptions['groups'][$key])) { $this->log("A group configuration for \"{$key}\" was not found"); return $options;