-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use System.Text.Json by default #1005
Conversation
@@ -1058,7 +1062,7 @@ public void MethodsShouldBeCancellableDefault() | |||
{ | |||
var fixture = new RequestBuilderImplementation<ICancellableMethods>(); | |||
var factory = fixture.RunRequest("GetWithCancellation"); | |||
var output = factory(new object[0]); | |||
var output = factory(Array.Empty<object>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not know this exists, but it looks like it's not even new. I assume it's cheaper than creating an empty array every time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, removes allocations
@@ -20,7 +20,7 @@ public CachedRequestBuilderImplementation(IRequestBuilder innerBuilder) | |||
} | |||
|
|||
readonly IRequestBuilder innerBuilder; | |||
readonly ConcurrentDictionary<string, Func<HttpClient, object[], object>> methodDictionary = new ConcurrentDictionary<string, Func<HttpClient, object[], object>>(); | |||
readonly ConcurrentDictionary<string, Func<HttpClient, object[], object>> methodDictionary = new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Implements and fixes #981
Refit now uses System.Text.Json by default and provides a new package containing support for Newtonsoft.Json.
Todo: Update docs.
@anaisbetts @bennor