From 314bc98044ffde3cfc5fa8942ab5016c56432669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 2 Apr 2023 00:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kiri-engine/Pool/Pool.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kiri-engine/Pool/Pool.php b/kiri-engine/Pool/Pool.php index e2810563..bc03f900 100644 --- a/kiri-engine/Pool/Pool.php +++ b/kiri-engine/Pool/Pool.php @@ -158,10 +158,10 @@ class Pool extends Component public function get($name, $callback): mixed { $channel = $this->channel($name); - if (!$channel->isEmpty()) { - return $channel->pop(); + if ($channel->isEmpty()) { + $channel->push($callback()); } - return $callback(); + return $channel->pop(); }