MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / hllDenseAdd

Function hllDenseAdd

src/hyperloglog.cpp:513–518  ·  view source on GitHub ↗

"Add" the element in the dense hyperloglog data structure. * Actually nothing is added, but the max 0 pattern counter of the subset * the element belongs to is incremented if needed. * * This is just a wrapper to hllDenseSet(), performing the hashing of the * element in order to retrieve the index and zero-run count. */

Source from the content-addressed store, hash-verified

511 * This is just a wrapper to hllDenseSet(), performing the hashing of the
512 * element in order to retrieve the index and zero-run count. */
513int hllDenseAdd(uint8_t *registers, unsigned char *ele, size_t elesize) {
514 long index;
515 uint8_t count = hllPatLen(ele,elesize,&index);
516 /* Update the register if this element produced a longer run of zeroes. */
517 return hllDenseSet(registers,index,count);
518}
519
520/* Compute the register histogram in the dense representation. */
521void hllDenseRegHisto(uint8_t *registers, int* reghisto) {

Callers 2

hllAddFunction · 0.85
pfselftestCommandFunction · 0.85

Calls 2

hllPatLenFunction · 0.85
hllDenseSetFunction · 0.85

Tested by

no test coverage detected