From 5536545f220e04675efde2ba20212f0f665b59c2 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 25 Apr 2024 17:33:35 +0800 Subject: [PATCH] :art: Clean code --- kernel/model/attribute_view.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 9a438d618..449681b67 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -186,7 +186,7 @@ type SearchAttributeViewResult struct { HPath string `json:"hPath"` } -func SearchAttributeView(keyword string, excludes []string) (ret []*SearchAttributeViewResult) { +func SearchAttributeView(keyword string, excludeAvIDs []string) (ret []*SearchAttributeViewResult) { waitForSyncingStorages() ret = []*SearchAttributeViewResult{} @@ -311,6 +311,9 @@ func SearchAttributeView(keyword string, excludes []string) (ret []*SearchAttrib break } } + if exist { + continue + } var hPath string baseBlock := treenode.GetBlockTreeRootByPath(node.Box, node.Path) @@ -322,7 +325,7 @@ func SearchAttributeView(keyword string, excludes []string) (ret []*SearchAttrib hPath = box.Name + hPath } - if !exist && !gulu.Str.Contains(avID, excludes) { + if !gulu.Str.Contains(avID, excludeAvIDs) { ret = append(ret, &SearchAttributeViewResult{ AvID: avID, AvName: existAv.AvName,