Currently, the name of bucket is a bit confusing, because it is considered a 'table' in literature (as well as the whole hash table). A bucket is better described as a 'subtable', which is used by the total hash table to perform cuckoo hashing.
In addition, the constructors NewTable, NewTableBy, and NewCustomTable were given shorter names, because the package name cuckoo already implies that New* would create a hash table with cuckoo hashing. This package has one use-case, and so it unambiguous what constructors produce.
Changes
NewTable -> New
NewTableBy -> NewBy
NewCustomTable -> NewCustom
bucket -> subtable
Design Decisions
I would have renamed Table and subtable to map equivalents, but 'submap' implies that a certain subsection of the map is contained within it, which isn't quite right.
I chose not to go with Map and table, because of the split naming convention.
Checklist
Tests pass
Docs updated
## Description
Currently, the name of `bucket` is a bit confusing, because it is considered a 'table' in literature (as well as the whole hash table). A `bucket` is better described as a 'subtable', which is used by the total hash table to perform cuckoo hashing.
In addition, the constructors `NewTable`, `NewTableBy`, and `NewCustomTable` were given shorter names, because the package name `cuckoo` already implies that `New*` would create a hash table with cuckoo hashing. This package has one use-case, and so it unambiguous what constructors produce.
## Changes
- `NewTable` -> `New`
- `NewTableBy` -> `NewBy`
- `NewCustomTable` -> `NewCustom`
- `bucket` -> `subtable`
### Design Decisions
- I would have renamed `Table` and `subtable` to map equivalents, but 'submap' implies that a certain subsection of the map is contained within it, which isn't quite right.
- I chose not to go with `Map` and `table`, because of the split naming convention.
## Checklist
- [x] Tests pass
- [x] Docs updated
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Currently, the name of
bucketis a bit confusing, because it is considered a 'table' in literature (as well as the whole hash table). Abucketis better described as a 'subtable', which is used by the total hash table to perform cuckoo hashing.In addition, the constructors
NewTable,NewTableBy, andNewCustomTablewere given shorter names, because the package namecuckooalready implies thatNew*would create a hash table with cuckoo hashing. This package has one use-case, and so it unambiguous what constructors produce.Changes
NewTable->NewNewTableBy->NewByNewCustomTable->NewCustombucket->subtableDesign Decisions
Tableandsubtableto map equivalents, but 'submap' implies that a certain subsection of the map is contained within it, which isn't quite right.Mapandtable, because of the split naming convention.Checklist