File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ class WeakLookupTable<Element: Identifiable & AnyObject> {
109
109
110
110
/// Finds the bucket where the object with the specified id should be stored
111
111
/// to.
112
- private func _findHole( _ id: Element . Identifier ) -> ( pos: Int , found: Bool ) {
112
+ private
113
+ func _findHole( _ id: Element . Identifier ) -> ( pos: Int , alreadyExists: Bool ) {
113
114
var bucket = _idealBucket ( for: id)
114
115
115
116
// Starting from the ideal bucket for the id, search an available bucket,
@@ -190,8 +191,8 @@ class WeakLookupTable<Element: Identifiable & AnyObject> {
190
191
/// Inserts the given object into the table.
191
192
@discardableResult
192
193
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 {
195
196
return false
196
197
}
197
198
You can’t perform that action at this time.
0 commit comments