From 89ffb1217f734afca4fbbd915a3fc76271dab991 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 4 Mar 2010 23:22:15 -0700 Subject: [PATCH] Don't hardcode classname; optimize valuesToKeys() --- framework/Util/lib/Horde/Array.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/framework/Util/lib/Horde/Array.php b/framework/Util/lib/Horde/Array.php index a08495f86..1184bef52 100644 --- a/framework/Util/lib/Horde/Array.php +++ b/framework/Util/lib/Horde/Array.php @@ -31,14 +31,13 @@ class Horde_Array $addr = array_keys(array_flip($addr)); /* Sort the list. */ - usort($addr, array('Horde_Array', 'sortAddressList')); + usort($addr, array(__CLASS__, 'sortAddressList')); return $addr; } /** * Function used by usort() to sort an address list. - * e.g. usort($foo, array('Horde_Array', 'sortAddressList')); * * @param string $a Address #1. * @param string $b Address #2. @@ -194,12 +193,7 @@ class Horde_Array */ static public function valuesToKeys($array) { - if (!$array) { - return array(); - } - - $values = array_values($array); - return array_combine($values, $values); + return array_combine($array, $array); } /** -- 2.11.0