From 5571ae05b5fe70e02866e575fc97a6974a3c1cab Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 15 Apr 2020 12:40:23 +0100 Subject: [PATCH] AsyncPool: silence a warning about wrong key type getTaskId() returns int|null, although it won't happen after the ID has been set. --- src/pocketmine/scheduler/AsyncPool.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/scheduler/AsyncPool.php b/src/pocketmine/scheduler/AsyncPool.php index fb3de9824..390fdeb71 100644 --- a/src/pocketmine/scheduler/AsyncPool.php +++ b/src/pocketmine/scheduler/AsyncPool.php @@ -162,13 +162,14 @@ class AsyncPool{ } $task->progressUpdates = new \Threaded; - $task->setTaskId($this->nextTaskId++); + $taskId = $this->nextTaskId++; + $task->setTaskId($taskId); - $this->tasks[$task->getTaskId()] = $task; + $this->tasks[$taskId] = $task; $this->getWorker($worker)->stack($task); $this->workerUsage[$worker]++; - $this->taskWorkers[$task->getTaskId()] = $worker; + $this->taskWorkers[$taskId] = $worker; $this->workerLastUsed[$worker] = time(); }