Commit 1e86a912 authored by Dries's avatar Dries

- Patch #367711 by catch: shorten drupal_map_assoc(). Thanks almighty catch.

parent 643ad121
......@@ -1883,13 +1883,9 @@ function drupal_page_footer() {
* An associative array.
*/
function drupal_map_assoc($array, $function = NULL) {
if (!isset($function)) {
$result = array();
foreach ($array as $value) {
$result[$value] = $value;
}
return $result;
}
if (!isset($function) && !empty($array)) {
return array_combine($array, $array);
}
elseif (function_exists($function)) {
$result = array();
foreach ($array as $value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment