Skip to content

Commit 21b0fa1

Browse files
committed
Simplify Equals method
1 parent 0b2f84f commit 21b0fa1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Ramstack.Structures/Text/StringView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,8 @@ public override bool Equals([NotNullWhen(true)] object? obj)
737737
if (obj is null)
738738
return _length == 0;
739739

740-
if (obj is StringView)
741-
return Equals(this, Unsafe.Unbox<StringView>(obj));
740+
if (obj is StringView view)
741+
return Equals(this, view);
742742

743743
return obj is string s && Equals(s);
744744
}

0 commit comments

Comments
 (0)