fix: Removes broken OrderedHashSet and adds a simple OrderedSet (#1756)

> [!CAUTION]
> **BREAKING CHANGE**
> Removed `OrderdHashSet` and `PooledOrderedHashSet` due to bugs.

> [!NOTE]
> **Developer Note**
> The OrderedSet is not a full data structure. It is not particularly efficient. Pull Requests are welcome for a better implementation, especially if it ends up supporting `ISet<T>` and `IReadOnlySet<T>`

## Summary

The ordered hash set was buggy. It's kind of painful to implement, so for now, I added a simple `OrderedSet` to suffice for gumps. Please reach out if this causes disruption!
This commit is contained in:
Kamron Batman 2024-05-03 18:03:26 -07:00 • committed by GitHub
parent dc118d836f
commit 4ea1d79cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 121 additions and 1258 deletions

View file

@ -50,7 +50,7 @@ public static class OutgoingGumpPackets
private static readonly byte[] _layoutBuffer = GC.AllocateUninitializedArray<byte>(0x20000);
private static readonly byte[] _stringsBuffer = GC.AllocateUninitializedArray<byte>(0x20000);
private static readonly byte[] _packBuffer = GC.AllocateUninitializedArray<byte>(0x20000);
private static readonly OrderedHashSet<string> _stringsList = new(32);
private static readonly OrderedSet<string> _stringsList = new();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void WritePacked(ReadOnlySpan<byte> span, ref SpanWriter writer)