diff options
| author | Tyge Løvset <[email protected]> | 2022-04-25 20:03:04 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-25 20:03:04 +0200 |
| commit | 29b1fb689c71837616023b3adc78eda3d32026b2 (patch) | |
| tree | 63f0bd3532f1819fb31d32c9c1c203eade79ea0c /include/stc/cmap.h | |
| parent | 72b40c6f5bbfbf11eba112a42ca5536c4c8e7d8f (diff) | |
| download | STC-modified-29b1fb689c71837616023b3adc78eda3d32026b2.tar.gz STC-modified-29b1fb689c71837616023b3adc78eda3d32026b2.zip | |
Removed size argument to `i_hash` template parameter and `c_default_hash`. This was a "design error", and is not worth keeping for backward compability. Please update your code where you use i_hash template parameter (simply remove second argument).
Diffstat (limited to 'include/stc/cmap.h')
| -rw-r--r-- | include/stc/cmap.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h index 978d624a..25356e16 100644 --- a/include/stc/cmap.h +++ b/include/stc/cmap.h @@ -294,7 +294,7 @@ STC_DEF void _cx_memb(_clear)(_cx_self* self) { STC_DEF chash_bucket_t
_cx_memb(_bucket_)(const _cx_self* self, const _cx_rawkey* rkeyptr) {
- const uint64_t _hash = i_hash(rkeyptr, (sizeof *rkeyptr));
+ const uint64_t _hash = i_hash(rkeyptr);
uint8_t _hx; _cx_size _cap = self->bucket_count;
chash_bucket_t b = {c_paste(fastrange_,i_size)(_hash, _cap), (uint8_t)(_hash | 0x80)};
const uint8_t* _hashx = self->_hashx;
@@ -380,7 +380,7 @@ _cx_memb(_erase_entry)(_cx_self* self, _cx_value* _val) { if (! _hashx[j])
break;
_cx_rawkey _raw = i_keyto(_i_keyref(_slot + j));
- k = c_paste(fastrange_,i_size)(i_hash((&_raw), (sizeof _raw)), _cap);
+ k = c_paste(fastrange_,i_size)(i_hash((&_raw)), _cap);
if ((j < i) ^ (k <= i) ^ (k > j)) /* is k outside (i, j]? */
_slot[i] = _slot[j], _hashx[i] = _hashx[j], i = j;
}
|
