Skip to content

Commit cf19037

Browse files
committed
suppress ide0047 for parentheses
1 parent 72dafec commit cf19037

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Polly.Core/Retry/RetryHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
13
namespace Polly.Retry;
24

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

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

0 commit comments

Comments
 (0)