Resize the table to the minimal size that contains all the elements, * but with the invariant of a USED/BUCKETS ratio near to <= 1 */
| 184 | /* Resize the table to the minimal size that contains all the elements, |
| 185 | * but with the invariant of a USED/BUCKETS ratio near to <= 1 */ |
| 186 | int dictResize(dict *d) |
| 187 | { |
| 188 | unsigned long minimal; |
| 189 | |
| 190 | if (!dict_can_resize || dictIsRehashing(d)) return DICT_ERR; |
| 191 | minimal = d->ht[0].used; |
| 192 | if (minimal < DICT_HT_INITIAL_SIZE) |
| 193 | minimal = DICT_HT_INITIAL_SIZE; |
| 194 | return _dictExpand(d, minimal, false /*fShirnk*/, nullptr); |
| 195 | } |
| 196 | |
| 197 | int dictMerge(dict *dst, dict *src) |
| 198 | { |
no test coverage detected