Optimization: skip one function call in CoreFunc::call

This commit is contained in:
Pekka Laiho 2020-12-03 20:23:26 +07:00
parent b360e213bf
commit 5bb2b458b3
3 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -33,4 +33,9 @@ class UserFunc extends Func
return $newEnv;
}
public function call(array $args)
{
return ($this->closure)(...$args);
}
}