diff -r bb17790af41e -r fd3368c20413 src/cx/hash_map.h --- a/src/cx/hash_map.h Fri May 27 14:14:55 2022 +0200 +++ b/src/cx/hash_map.h Fri May 27 17:40:27 2022 +0200 @@ -108,41 +108,23 @@ /** * Increases the number of buckets, if necessary. * - * The load value is \c loadFactor*buckets. If the element count exceeds the load - * value, the map needs to be rehashed. Otherwise, no action is performed and + * The load threshold is \c 0.75*buckets. If the element count exceeds the load + * threshold, the map will be rehashed. Otherwise, no action is performed and * this function simply returns 0. * * The rehashing process ensures, that the number of buckets is at least - * \p bucketFactor times the number of stored items. So there is enough room for additional + * 2.5 times the element count. So there is enough room for additional * elements without the need of another soon rehashing. * - * You can use this function after filling a map to dramatically increase access performance. + * You can use this function after filling a map to increase access performance. * * @note If the specified map is not a hash map, the behavior is undefined. * * @param map the map to rehash - * @param loadFactor a percentage threshold for the load of the map - * @param bucketFactor a factor for the number of buckets that shall be available after rehashing * @return zero on success, non-zero if a memory allocation error occurred */ __attribute__((__nonnull__)) -int cxMapRehash2( - CxMap *map, - float loadFactor, - float bucketFactor -); - -/** - * Rehashes the map with load factor 0.75 and bucket factor 2.5. - * - * @param map the map to rehash - * @return zero on success, non-zero if a memory allocation error occurred - * @see cxMapRehash2() - */ -__attribute__((__nonnull__)) -static inline int cxMapRehash(CxMap *map) { - return cxMapRehash2(map, 0.75f, 2.5f); -} +int cxMapRehash(CxMap *map); #ifdef __cplusplus