Skip to content

Commit f8eb25e

Browse files
haugjanCopilot
andauthored
Update Flow.ConfluenceSearch/ConfluenceClient/QueryBuilderExtensions.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9bcadc5 commit f8eb25e

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

Flow.ConfluenceSearch/ConfluenceClient/QueryBuilderExtensions.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,11 @@ Func<string, Task<IEnumerable<string>>> convertCapture
8888
if (!query.Captures.Any())
8989
return query;
9090

91-
var convertedTokensList = new List<string>();
92-
foreach (var capture in query.Captures)
93-
{
94-
var converted = await convertCapture(capture);
95-
convertedTokensList.AddRange(converted);
96-
}
97-
98-
var tokens = convertedTokensList.Distinct().ToImmutableList();
99-
91+
var convertedTokens = await Task.WhenAll(query.Captures.Select(convertCapture));
92+
var tokens = convertedTokens
93+
.SelectMany(x => x)
94+
.Distinct()
95+
.ToImmutableList();
10096
return query with
10197
{
10298
Captures = ImmutableList<string>.Empty,

0 commit comments

Comments
 (0)