diff --git a/Heap/Heap.swift b/Heap/Heap.swift index 7560bc7b9..42f20ca03 100755 --- a/Heap/Heap.swift +++ b/Heap/Heap.swift @@ -209,7 +209,7 @@ extension Heap where T: Equatable { /** Get the index of a node in the heap. Performance: O(n). */ public func index(of node: T) -> Int? { - return nodes.index(where: { $0 == node }) + return nodes.firstIndex(where: { $0 == node }) } /** Removes the first occurrence of a node from the heap. Performance: O(n). */