diff --git a/src/Ramstack.HtmxToolkit/Collections/SmallDictionary.cs b/src/Ramstack.HtmxToolkit/Collections/SmallDictionary.cs index 476f206..d42f881 100644 --- a/src/Ramstack.HtmxToolkit/Collections/SmallDictionary.cs +++ b/src/Ramstack.HtmxToolkit/Collections/SmallDictionary.cs @@ -55,8 +55,8 @@ public TValue this[TKey key] } set { - var items = _items; var index = IndexOf(key); + var items = _items; if ((uint)index < (uint)items.Length) { @@ -241,8 +241,8 @@ void ICollection>.CopyTo(KeyValuePair[] /// bool ICollection>.Remove(KeyValuePair item) { - var items = _items; var index = IndexOf(item.Key); + var items = _items; if ((uint)index >= (uint)items.Length) return false; diff --git a/src/Ramstack.HtmxToolkit/Collections/SmallDictionaryDebugView.cs b/src/Ramstack.HtmxToolkit/Collections/SmallDictionaryDebugView.cs index 37200c3..f44ffbd 100644 --- a/src/Ramstack.HtmxToolkit/Collections/SmallDictionaryDebugView.cs +++ b/src/Ramstack.HtmxToolkit/Collections/SmallDictionaryDebugView.cs @@ -35,7 +35,8 @@ public DictionaryEntry[] Items /// /// Represents a class that contains the key/value pairs of the dictionary entry for displaying by a debugger. /// - /// The value of the entry. + /// The key of the entry. + /// The value of the entry. [DebuggerDisplay("{Value}", Name = "[{Key}]")] public readonly struct DictionaryEntry(TKey key, TValue value) {