stdlib: replace _squeezeHashValue with a specialized version for power-of-2 ranges.

This function is only used for Set and Dictionary and there the range (which is the capacity) is always a power of 2.
This commit is contained in:
Erik Eckstein
2016-09-19 17:48:36 -07:00
parent 36ef0e6cd7
commit 8b1184708e
3 changed files with 21 additions and 77 deletions

View File

@@ -2805,7 +2805,7 @@ struct _Native${Self}Storage<${TypeParametersDecl}> :
@_versioned
internal func _bucket(_ k: Key) -> Int {
return _squeezeHashValue(k.hashValue, 0..<capacity)
return _squeezeHashValue(k.hashValue, capacity)
}
@_versioned