Skip to content

Commit 2db26db

Browse files
Update codeflash/result/common_tags.py
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
1 parent b50c900 commit 2db26db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

codeflash/result/common_tags.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
55
if not articles:
66
return set()
77

8-
common_tags = articles[0].get("tags", [])
8+
common_tags = set(articles[0].get("tags", []))
99
for article in articles[1:]:
10-
common_tags = [tag for tag in common_tags if tag in article.get("tags", [])]
11-
return set(common_tags)
10+
common_tags.intersection_update(article.get("tags", []))
11+
if not common_tags:
12+
break
13+
return common_tags

0 commit comments

Comments
 (0)