From 326bdce5b923e96af3d2f620f5b2740be1a7759a Mon Sep 17 00:00:00 2001 From: Christopher R Schuchardt Date: Tue, 13 Feb 2024 05:16:12 -0500 Subject: [PATCH] Fixed iterate same `x`, `y` in `ByteArrayComparer.Compare` --- src/Neo.IO/ByteArrayComparer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Neo.IO/ByteArrayComparer.cs b/src/Neo.IO/ByteArrayComparer.cs index c6815419c1..b59c5a28f5 100644 --- a/src/Neo.IO/ByteArrayComparer.cs +++ b/src/Neo.IO/ByteArrayComparer.cs @@ -29,6 +29,7 @@ private ByteArrayComparer(int direction) public int Compare(byte[]? x, byte[]? y) { + if (x is not null && y is not null && x == y) return 0; if (x is null && y is not null) return _direction > 0 ? -y.Length : y.Length; if (y is null && x is not null)