Skip to content

Commit

Permalink
suppress ide0047 for parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyertons committed Oct 16, 2023
1 parent 72dafec commit cf19037
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Polly.Core/Retry/RetryHelper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Diagnostics.CodeAnalysis;

namespace Polly.Retry;

internal static class RetryHelper
Expand Down Expand Up @@ -112,9 +114,10 @@ private static TimeSpan DecorrelatedJitterBackoffV2(int attempt, TimeSpan baseDe
return TimeSpan.FromTicks((long)Math.Min(formulaIntrinsicValue * RpScalingFactor * targetTicksFirstDelay, maxTimeSpanDouble));
}

[SuppressMessage("Style", "IDE0047", Justification = "Parentheses offer less mental gymnastics")]
private static TimeSpan ApplyJitter(TimeSpan delay, Func<double> randomizer)
{
var offset = delay.TotalMilliseconds * JitterFactor / 2;
var offset = (delay.TotalMilliseconds * JitterFactor) / 2;
var randomDelay = (delay.TotalMilliseconds * JitterFactor * randomizer()) - offset;
var newDelay = delay.TotalMilliseconds + randomDelay;

Expand Down

0 comments on commit cf19037

Please sign in to comment.