refactor: drop redundant len(tag_ids)==0 check in get_target_ids_by_tag_ids (#38447)

This commit is contained in:
i晟
2026-07-06 04:35:58 +00:00
committed by GitHub
parent 94c0967e30
commit 586c8de1a0
2 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ class TagService:
target must be bound to all requested tags.
"""
# Check if tag_ids is not empty to avoid WHERE false condition
if not tag_ids or len(tag_ids) == 0:
if not tag_ids:
return []
# Deduplicate repeated query params so match_all counts each requested tag once.
requested_tag_ids = list(dict.fromkeys(tag_ids))
@@ -88,7 +88,7 @@ class TagService:
return []
tag_ids = list(tags)
# Check if tag_ids is not empty to avoid WHERE false condition
if not tag_ids or len(tag_ids) == 0:
if not tag_ids:
return []
if match_all:
if len(tag_ids) != len(requested_tag_ids):