Skip to content

Commit

Permalink
use Select to convert Interface to implementation type
Browse files Browse the repository at this point in the history
use Select to convert Interface to implementation type
  • Loading branch information
alec1o committed Jun 29, 2024
1 parent 2bbfcb0 commit 50c19b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/http/partials/Server/HTTP.ServerTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,27 +240,27 @@ private void HandleConnection(HttpListenerContext context)
}

return false;
}).ToArray();
}).Select(x => (MiddlewareDescriptor)x).ToArray();

if (descriptors.Length > 0)
{
var count = descriptors.Length;

for (var i = 0; i < count; i++)
{
var descriptor = (MiddlewareDescriptor)descriptors[i];
var descriptor = descriptors[i];

try
{
descriptor.Next = (MiddlewareDescriptor)descriptors[i + 1];
descriptor.Next = descriptors[i + 1];
}
catch
{
descriptor.Next = null;
}
}

var mainDescriptor = (MiddlewareDescriptor)descriptors[0];
var mainDescriptor = descriptors[0];
mainDescriptor.Callback(request, response, () => mainDescriptor.Execute(request, response));
}
}
Expand Down

0 comments on commit 50c19b6

Please sign in to comment.