From a54b17167eb17d8e7dc4b8b17d441131efade3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Bj=C3=B6rnstam?= Date: Thu, 23 Apr 2026 17:08:12 +0200 Subject: [PATCH] Fixed the unicode strategy to avoid boxing --- PersistentMap/KeyStrategies.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PersistentMap/KeyStrategies.cs b/PersistentMap/KeyStrategies.cs index 2bc14a6..f53d5a2 100644 --- a/PersistentMap/KeyStrategies.cs +++ b/PersistentMap/KeyStrategies.cs @@ -16,7 +16,6 @@ public interface IKeyStrategy bool UsesPrefixes => true; - // bool IsLossless => false; bool UseBinarySearch => false; } @@ -26,6 +25,10 @@ public interface IKeyStrategy public struct UnicodeStrategy : IKeyStrategy { + + bool UsesPrefixes => true; + bool UseBinarySearch => false; + bool IsLossLess => false; [MethodImpl(MethodImplOptions.AggressiveInlining)] public int Compare(string? x, string? y) => string.CompareOrdinal(x, y); @@ -58,7 +61,6 @@ public struct UnicodeStrategy : IKeyStrategy return packed ^ unchecked((long)0x8080808080808080); } - public bool UsesPrefixes => true; }