mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-26 15:14:12 +00:00
Optimization: skip one function call in CoreFunc::call
This commit is contained in:
parent
b360e213bf
commit
5bb2b458b3
@ -22,7 +22,7 @@ class CoreFunc extends Func
|
|||||||
{
|
{
|
||||||
$this->validateArgs(count($args));
|
$this->validateArgs(count($args));
|
||||||
|
|
||||||
return parent::call($args);
|
return ($this->closure)(...$args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validateArgs(int $count)
|
private function validateArgs(int $count)
|
||||||
|
@ -24,8 +24,5 @@ abstract class Func
|
|||||||
return $this->doc;
|
return $this->doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function call(array $args)
|
abstract public function call(array $args);
|
||||||
{
|
|
||||||
return ($this->closure)(...$args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -33,4 +33,9 @@ class UserFunc extends Func
|
|||||||
|
|
||||||
return $newEnv;
|
return $newEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function call(array $args)
|
||||||
|
{
|
||||||
|
return ($this->closure)(...$args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user