From: Jakub Vrana Date: Mon, 21 Mar 2011 08:53:41 +0000 (+0100) Subject: Avoid big ternary operator (saves memory) X-Git-Tag: v3.2.1~16 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=2f76084bbd8a6fb594543d0a7ea7ba7a13a89311;p=adminer.git Avoid big ternary operator (saves memory) --- 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)) {