Skip to content

Commit 3bc5134

Browse files
committed
refactor: Use is not instead of !=
1 parent 90049be commit 3bc5134

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/LinkDotNet.StringBuilder/ValueStringBuilder.AppendJoin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private void AppendJoinInternalString<T>(ReadOnlySpan<char> separator, IEnumerab
5555
}
5656

5757
var current = enumerator.Current;
58-
if (current != null)
58+
if (current is not null)
5959
{
6060
AppendInternal(current);
6161
}

src/LinkDotNet.StringBuilder/ValueStringBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public readonly int LastIndexOf(ReadOnlySpan<char> word, int startIndex)
288288
[MethodImpl(MethodImplOptions.AggressiveInlining)]
289289
public void Dispose()
290290
{
291-
if (arrayFromPool != null)
291+
if (arrayFromPool is not null)
292292
{
293293
ArrayPool<char>.Shared.Return(arrayFromPool);
294294
}
@@ -328,7 +328,7 @@ ref Unsafe.As<char, byte>(ref sourceRef),
328328
var oldBufferFromPool = arrayFromPool;
329329
buffer = arrayFromPool = rented;
330330

331-
if (oldBufferFromPool != null)
331+
if (oldBufferFromPool is not null)
332332
{
333333
ArrayPool<char>.Shared.Return(oldBufferFromPool);
334334
}

0 commit comments

Comments
 (0)