From c7961b755523a0ea7e123591129512f6e8dfde8d Mon Sep 17 00:00:00 2001 From: bth Date: Mon, 8 Jun 2026 20:13:20 -0700 Subject: [PATCH] tag : simplify single tag handling --- tag/process.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tag/process.go b/tag/process.go index 1490f53..e54aada 100644 --- a/tag/process.go +++ b/tag/process.go @@ -48,17 +48,17 @@ func processQueries(tagmap map[string]Set, query Query) Set { set = Set{} } - // empty query + // single tag: no need for set logic whether the empty query or not // TODO: do I want to handle WILD and a tag? Actual regex? - if len(query.Tags) == 1 && query.Op == WILD && q == "" { - // NOTE: this is all files with at least one tag and therefore of value: - set.Union(slices.Collect(maps.Values(tagmap))...) - return set - } - // non-empty query of single tag: no need for set logic: if len(query.Tags) == 1 { + if query.Op == WILD && q == "" { + // NOTE: this is all files with at least one tag and therefore of value: + set.Union(slices.Collect(maps.Values(tagmap))...) + } + // non-empty query should return also: return set } + for _, t := range query.Tags { switch query.Op { case OR: