From 2f76084bbd8a6fb594543d0a7ea7ba7a13a89311 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 21 Mar 2011 09:53:41 +0100 Subject: [PATCH] Avoid big ternary operator (saves memory) --- adminer/include/functions.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 5e0525d9..e32e8db7 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -104,10 +104,12 @@ function checkbox($name, $value, $checked, $label = "", $onclick = "") { function optionlist($options, $selected = null, $use_keys = false) { $return = ""; foreach ($options as $k => $v) { + $opts = array($k => $v); if (is_array($v)) { $return .= ''; + $opts = $v; } - foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) { + foreach ($opts as $key => $val) { $return .= '' . h($val); } if (is_array($v)) {