From d2c1d130c96d08769ff6c6f2e38bc993d1447201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 5 Aug 2021 11:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Route/Node.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index b9f1d258..2ad237b6 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -261,14 +261,8 @@ class Node extends HttpService */ public function addChild(Node $node, string $field): Node { - $field = (string)$field; - /** @var Node $oLod */ - $oLod = $this->childes[$field] ?? null; - if (!empty($oLod)) { - $node = $oLod; - } - $this->childes[$field] = $node; - return $this->childes[$field]; + $this->childes[] = $node; + return $node; }