From 0fa494d3a8cf39dde2274b5ab734e4a72c8b6ea2 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Thu, 30 Apr 2026 13:25:25 -0700 Subject: [PATCH] [OrderedCollections] Minor fixes in _HashTable.UnsafeHandle --- .../HashTable/_HashTable+UnsafeHandle.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift index 6d9fc9b6..9795b2d1 100644 --- a/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift +++ b/Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift @@ -166,7 +166,7 @@ extension _HashTable.UnsafeHandle { } /// Return the index of the word logically preceding `word` in this hash table. - /// The buckets form a cycle, so the first word is logically preceded by the first. + /// The buckets form a cycle, so the first word is logically preceded by the last. /// /// Note that the last word may be only partially filled if `scale` is less than 6. @inlinable @@ -229,11 +229,11 @@ extension _HashTable.UnsafeHandle { @inlinable subscript(word word: Int) -> UInt64 { @inline(__always) get { - assert(word >= 0 && word < bucketCount) + assert(word >= 0 && word < wordCount) return _buckets[word] } @inline(__always) nonmutating set { - assert(word >= 0 && word < bucketCount) + assert(word >= 0 && word < wordCount) assertMutable() _buckets[word] = newValue }