Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwamboldt committed Feb 25, 2015
1 parent 6b57002 commit a718b37
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/utilphp/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,28 +279,28 @@ private static function initLanguageMap($language = '')

self::$regex = '/[' . self::$chars . ']/u';
}
/**
* Remove the duplicates from an array.
*
* This is faster version than the builtin array_unique().
*
* Notes on time requirements:
* array_unique -> O(n log n)
* array_flip -> O(n)
*
* http://stackoverflow.com/questions/8321620/array-unique-vs-array-flip
* http://php.net/manual/en/function.array-unique.php
*
* @param $array
* @return $array
*/
public static function fast_array_unique($array)
{
$array = array_keys(array_flip($array));

return $array;
}
/**
* Remove the duplicates from an array.
*
* This is faster version than the builtin array_unique().
*
* Notes on time requirements:
* array_unique -> O(n log n)
* array_flip -> O(n)
*
* http://stackoverflow.com/questions/8321620/array-unique-vs-array-flip
* http://php.net/manual/en/function.array-unique.php
*
* @param $array
* @return $array
*/
public static function fast_array_unique($array)
{
$array = array_keys(array_flip($array));

return $array;
}

/**
* Access an array index, retrieving the value stored there if it
Expand Down

0 comments on commit a718b37

Please sign in to comment.