From b54f71a64935601ec9eb5225cec94f4ecba651d5 Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 2 Jun 2023 05:07:11 +0000 Subject: [PATCH] * Optimize codes. --- module/bug/model.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 64f52d5993..3b3bb73b99 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -797,14 +797,12 @@ class bugModel extends model foreach($bugs as $bug) { $openBuildIdList = explode(',', $bug->openedBuild); + $openedBuild = ''; - foreach($openBuildIdList as $buildID) - { - $openedBuild .= isset($builds[$buildID]) ? $builds[$buildID] : $buildID; - $openedBuild .= ','; - } + foreach($openBuildIdList as $buildID) $openedBuild .= zget($builds, $buildID) . ','; + $bug->openedBuild = rtrim($openedBuild, ','); - $bug->resolvedBuild = isset($builds[$bug->resolvedBuild]) ? $builds[$bug->resolvedBuild] : $bug->resolvedBuild; + $bug->resolvedBuild = zget($builds, $bug->resolvedBuild); } return $bugs; }