Skip to content

Conversation

@Zombach
Copy link
Contributor

@Zombach Zombach commented Jul 20, 2024

Pull Request

The issue or feature being addressed

#2215

Details on the issue fix or feature implementation

  • Suppress CA1062 in src/Polly/Caching/ContextualTtl.cs or fix the warning

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature

/// <returns>TimeSpan.</returns>
public Ttl GetTtl(Context context, object? result)
{
if (context is null)
Copy link
Contributor Author

@Zombach Zombach Jul 20, 2024

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 ==

Copy link
Member

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
Copy link

codecov bot commented Jul 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.90%. Comparing base (e4ffcd4) to head (ccfc752).

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           
Flag Coverage Δ
linux 83.90% <100.00%> (+<0.01%) ⬆️
macos 83.90% <100.00%> (+<0.01%) ⬆️
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martincostello martincostello enabled auto-merge (squash) July 20, 2024 08:02
@martincostello martincostello added this to the v8.4.2 milestone Jul 20, 2024
@martincostello martincostello merged commit c75b43b into App-vNext:main Jul 20, 2024
@Zombach Zombach deleted the zombach/remove-warning-ca1062#contextual-ttl branch July 24, 2024 18:14
@martincostello martincostello removed this from the v8.4.2 milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants