Skip to content

Commit

Permalink
fix(CA1859): use concrete type for improved performance
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer committed Sep 30, 2024
1 parent 9ad4b85 commit 09a2457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MockHttp/Internal/HttpCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class HttpCall
{
private IResponseStrategy? _responseStrategy;
private string? _verifiableBecause;
private IReadOnlyCollection<IAsyncHttpRequestMatcher>? _matchers;
private ReadOnlyCollection<IAsyncHttpRequestMatcher>? _matchers;

public IReadOnlyCollection<IAsyncHttpRequestMatcher> Matchers
{
Expand Down Expand Up @@ -65,7 +65,7 @@ public virtual void SetMatchers(IEnumerable<IAsyncHttpRequestMatcher> matchers)
throw new ArgumentNullException(nameof(matchers));
}

_matchers = new ReadOnlyCollection<IAsyncHttpRequestMatcher>(matchers.ToList());
_matchers = matchers.ToList().AsReadOnly();
}

public virtual void SetCallback(Action<HttpRequestMessage> callback)
Expand Down

0 comments on commit 09a2457

Please sign in to comment.