Allow arbitrary hashtable increments. Fixes #1742 (#1897)
* Allow arbitrary hashtable increments. Fixes #1742 Right now incrementing some datastructure's values like maps or histograms can be done with some boilerplate[1] or with `increment` which increments a value by 1. This patch allows a second optional parameter to use as the increment. - [1]: ``` u64 zero = 0, *val; val = map.lookup_or_init(&key, &zero); (*val) += inc; ``` Notes: - Some lines in the documentation where changed because of trailing spaces deletion - The test is quite simple right now - Will update the tools to use `increment` in another PR * CR changes
Showing
Please register or sign in to comment