1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-12 05:23:02 +00:00

Update code.

This commit is contained in:
Calvin Rose
2018-03-14 21:46:56 -04:00
parent 8ec29d9326
commit 5f0bd1e082
3 changed files with 50 additions and 15 deletions

View File

@@ -61,11 +61,10 @@ const DstKV *dst_struct_find(const DstKV *st, Dst key) {
* Nil keys and values are ignored, extra keys are ignore, and duplicate keys are
* ignored.
*
* Much of this complexity is in the robinhood hashing scheme, an
* attempt to make structs that are created with arguments in a different
* order to have the same internal representation. If this turns out to be
* incorrect or too complicated, another scheme that would definitely work
* is inserting all keys in sorted order with any deterministic hashing scheme. */
* Runs will be in sorted order, as the collisions resolver essentially
* preforms an in-place insertion sort. This ensures the internal structure of the
* hash map is independant of insertion order.
*/
void dst_struct_put(DstKV *st, Dst key, Dst value) {
int32_t cap = dst_struct_capacity(st);
int32_t hash = dst_hash(key);