Skip to content

[stdlib] Set, Dictionary: Enable per-instance hash seeds #19533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions stdlib/public/core/HashTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ extension _HashTable {
for object: AnyObject,
scale: Int8
) -> Int {
#if false // FIXME: Enable per-instance seeding
// We generate a new hash seed whenever a new hash table is allocated and
// whenever an existing table is resized, so that we avoid certain copy
// operations becoming quadratic. (For background details, see
Expand All @@ -115,10 +114,6 @@ extension _HashTable {
// guarantee that no two tables with the same seed can coexist at the same
// time (apart from copy-on-write derivatives of the same table).
return unsafeBitCast(object, to: Int.self)
#else
// Use per-capacity seeding for now.
return Int(scale)
#endif
}
}

Expand Down