Skip to content

Commit 061301b

Browse files
committed
[WeakLookupTable] Rename the tuple label in return type of _findHole
Rename 'found' to 'alreadyExists'. 'found' implies that we found a hole which we will always do.
1 parent 23778cb commit 061301b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Sources/SwiftSyntax/WeakLookupTable.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ class WeakLookupTable<Element: Identifiable & AnyObject> {
109109

110110
/// Finds the bucket where the object with the specified id should be stored
111111
/// to.
112-
private func _findHole(_ id: Element.Identifier) -> (pos: Int, found: Bool) {
112+
private
113+
func _findHole(_ id: Element.Identifier) -> (pos: Int, alreadyExists: Bool) {
113114
var bucket = _idealBucket(for: id)
114115

115116
// Starting from the ideal bucket for the id, search an available bucket,
@@ -190,8 +191,8 @@ class WeakLookupTable<Element: Identifiable & AnyObject> {
190191
/// Inserts the given object into the table.
191192
@discardableResult
192193
func insert(_ obj: Element) -> Bool {
193-
var (pos, found) = _findHole(obj.id)
194-
if found {
194+
var (pos, alreadyExists) = _findHole(obj.id)
195+
if alreadyExists {
195196
return false
196197
}
197198

0 commit comments

Comments
 (0)