mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 13:24:46 +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));
|
||||
|
||||
return parent::call($args);
|
||||
return ($this->closure)(...$args);
|
||||
}
|
||||
|
||||
private function validateArgs(int $count)
|
||||
|
@ -24,8 +24,5 @@ abstract class Func
|
||||
return $this->doc;
|
||||
}
|
||||
|
||||
public function call(array $args)
|
||||
{
|
||||
return ($this->closure)(...$args);
|
||||
}
|
||||
abstract public function call(array $args);
|
||||
}
|
||||
|
@ -33,4 +33,9 @@ class UserFunc extends Func
|
||||
|
||||
return $newEnv;
|
||||
}
|
||||
|
||||
public function call(array $args)
|
||||
{
|
||||
return ($this->closure)(...$args);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user