MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hllSparseAdd

Function hllSparseAdd

app/redis-6.2.6/src/hyperloglog.c:903–908  ·  view source on GitHub ↗

"Add" the element in the sparse 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 function is actually a wrapper for hllSparseSet(), it only performs * the hashshing of the element to obtain the index and zeros run length. */

Source from the content-addressed store, hash-verified

901 * This function is actually a wrapper for hllSparseSet(), it only performs
902 * the hashshing of the element to obtain the index and zeros run length. */
903int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
904 long index;
905 uint8_t count = hllPatLen(ele,elesize,&index);
906 /* Update the register if this element produced a longer run of zeroes. */
907 return hllSparseSet(o,index,count);
908}
909
910/* Compute the register histogram in the sparse representation. */
911void hllSparseRegHisto(uint8_t *sparse, int sparselen, int *invalid, int* reghisto) {

Callers 1

hllAddFunction · 0.85

Calls 2

hllPatLenFunction · 0.85
hllSparseSetFunction · 0.85

Tested by

no test coverage detected