Оптимизации и исправления топов.
This commit is contained in:
parent
77fa3dbd5e
commit
0f4b2fb722
25 changed files with 109 additions and 53 deletions
|
|
@ -53,7 +53,8 @@ class __partial {
|
|||
function apply() {
|
||||
$params = func_get_args();
|
||||
$result = array();
|
||||
for($i = 0, $j = 0; $i < count($this->params); $i++) {
|
||||
$count = count($this->params);
|
||||
for($i = 0, $j = 0; $i < $count; $i++) {
|
||||
if ($this->params[$i] == __) {
|
||||
$result [] = $params[$j];
|
||||
$j++;
|
||||
|
|
@ -77,7 +78,8 @@ class __compose {
|
|||
function apply () {
|
||||
$params = func_get_args ();
|
||||
$result = call_user_func_array($this->fns[0], $params);
|
||||
for ($i = 1; $i < count($this->fns); $i++) {
|
||||
$count = count($this->fns);
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$result = call_user_func($this->fns[$i], $result);
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -306,7 +308,8 @@ class Functions {
|
|||
assert(is_int($length));
|
||||
|
||||
$result = array();
|
||||
for($i = 0; $i < count($array); $i += $length) {
|
||||
$count = count($array);
|
||||
for($i = 0; $i < $count; $i += $length) {
|
||||
$result [] = array_slice($array, $i, $length);
|
||||
}
|
||||
return $result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue