2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-09-13 20:43:19 +00:00
This commit is contained in:
2025-08-26 06:12:59 +03:00
parent 4a7070ee6e
commit dde86c9af7
8 changed files with 60 additions and 45 deletions

View File

@@ -86,14 +86,15 @@ public class AsyncBag<T> : AsyncReply, IAsyncBag
for (var i = 0; i < replies.Count; i++)
{
var k = replies[i];
var index = i;
if (k is AsyncReply)
if (k is AsyncReply reply)
{
(k as AsyncReply).Then((r) =>
reply.Then((r) =>
{
results.SetValue(r, i);
results.SetValue(r, index);
count++;
if (count == replies.Count)
Trigger(results);
@@ -101,7 +102,7 @@ public class AsyncBag<T> : AsyncReply, IAsyncBag
}
else
{
results.SetValue(replies[i], i);
results.SetValue(replies[i], index);
count++;
if (count == replies.Count)
Trigger(results);