refactor!: remove MinimumLoad() option #17

Merged
mvhutz merged 3 commits from feat/remove-minimum-load-option into main 2026-04-03 14:51:41 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 0bdf71fd12 - Show all commits

View File

@@ -12,12 +12,12 @@ const DefaultCapacity uint64 = 16
// hash table implementations use 2. // hash table implementations use 2.
const DefaultGrowthFactor uint64 = 2 const DefaultGrowthFactor uint64 = 2
// MinimumLoad is the default lowest acceptable occupancy of a [Table]. The // defaultMinimumLoad is the default lowest acceptable occupancy of a [Table].
// higher the minimum load, the more likely that a [Table.Put] will not succeed. // The higher the minimum load, the more likely that a [Table.Put] will not
// The value of 5% is taken from [libcuckoo]. // succeed. The value of 5% is taken from [libcuckoo].
// //
// [libcuckoo]: https://github.com/efficient/libcuckoo/blob/656714705a055df2b7a605eb3c71586d9da1e119/libcuckoo/cuckoohash_config.hh#L21 // [libcuckoo]: https://github.com/efficient/libcuckoo/blob/656714705a055df2b7a605eb3c71586d9da1e119/libcuckoo/cuckoohash_config.hh#L21
const MinimumLoad float64 = 0.05 const defaultMinimumLoad float64 = 0.05
type settings struct { type settings struct {
growthFactor uint64 growthFactor uint64

View File

@@ -198,7 +198,7 @@ func NewCustomTable[K, V any](hashA, hashB Hash[K], compare EqualFunc[K], option
settings := &settings{ settings := &settings{
growthFactor: DefaultGrowthFactor, growthFactor: DefaultGrowthFactor,
bucketSize: DefaultCapacity, bucketSize: DefaultCapacity,
minLoadFactor: MinimumLoad, minLoadFactor: defaultMinimumLoad,
} }
for _, option := range options { for _, option := range options {