Created
April 9, 2017 18:11
-
-
Save nathankrishnan/a12b1069afb62f509488c454c16f4213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func query(_ value: T) -> Bool { | |
let hashValuePositions = computeHashes(value) | |
let valuesAtIndices = hashValuePositions.map() { hashValuePosition in array[hashValuePosition] } | |
let exists = valuesAtIndices.reduce(true, { $0 && $1 }) | |
return exists | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment