-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix warning CA1062#ContextualTtl #2217
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
Fix warning CA1062#ContextualTtl #2217
Conversation
| /// <returns>TimeSpan.</returns> | ||
| public Ttl GetTtl(Context context, object? result) | ||
| { | ||
| if (context is null) |
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.
@martincostello
Which is better to use? == or the pattern is
The is mapping pattern, but mostly the code uses ==
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.
I would use is for new code where it is equivalent to == null. Don't worry about updating existing code to match - it was written before is was a thing.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2217 +/- ##
=======================================
Coverage 83.89% 83.90%
=======================================
Files 313 313
Lines 7179 7181 +2
Branches 1060 1061 +1
=======================================
+ Hits 6023 6025 +2
Misses 785 785
Partials 371 371
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request
The issue or feature being addressed
#2215
Details on the issue fix or feature implementation
Confirm the following