Remove validateCallableSignature() calls from network hot paths

we rely on phpstan for validation of this internally, and plugins shouldn't be calling these methods anyway.
this significantly reduces the overhead of CompressBatchPromise.
This commit is contained in:
Dylan K. Taylor 2023-05-16 14:21:32 +01:00
parent d317347a9b
commit a4fea1444a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 0 additions and 5 deletions

View File

@ -1000,8 +1000,6 @@ class NetworkSession{
* @phpstan-param \Closure() : void $onCompletion
*/
public function startUsingChunk(int $chunkX, int $chunkZ, \Closure $onCompletion) : void{
Utils::validateCallableSignature(function() : void{}, $onCompletion);
$world = $this->player->getLocation()->getWorld();
ChunkCache::getInstance($world, $this->compressor)->request($chunkX, $chunkZ)->onResolve(

View File

@ -42,9 +42,6 @@ class CompressBatchPromise{
*/
public function onResolve(\Closure ...$callbacks) : void{
$this->checkCancelled();
foreach($callbacks as $callback){
Utils::validateCallableSignature(function(CompressBatchPromise $promise) : void{}, $callback);
}
if($this->result !== null){
foreach($callbacks as $callback){
$callback($this);