Skip to content

Commit a446ec9

Browse files
committed
Removed unnecessary CompareExchange calls in the ThrowOnNextStartupForTests property setter in SampleProfilerSession.cs.
One straggler from the PR review feedback that I somehow missed: explicitly discard an unused return value in one of the tests.
1 parent ab4c755 commit a446ec9

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/Sentry.Profiling/SampleProfilerSession.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ private SampleProfilerSession(SentryStopwatch stopwatch, EventPipeSession sessio
6161
internal static bool ThrowOnNextStartupForTests
6262
{
6363
get { return _throwOnNextStartupForTests; }
64-
set
65-
{
66-
if (value)
67-
_throwOnNextStartupForTests.CompareExchange(true, false);
68-
else
69-
_throwOnNextStartupForTests.CompareExchange(false, true);
70-
}
64+
set { _throwOnNextStartupForTests = value; }
7165
}
7266

7367
public static SampleProfilerSession StartNew(IDiagnosticLogger? logger = null)

test/Sentry.Tests/Internals/InterlockedBooleanTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void InterlockedBoolean_Exchange_SetsExpectedNewState(bool initialState,
9696
var expected = ToTBool(newValue);
9797

9898
// Act
99-
var result = sut.Exchange(newValue);
99+
var _ = sut.Exchange(newValue);
100100

101101
// Assert
102102
sut.ValueForTests.Should().Be(expected);

0 commit comments

Comments
 (0)