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

Function hllAdd

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

Call hllDenseAdd() or hllSparseAdd() according to the HLL encoding. */

Source from the content-addressed store, hash-verified

1049
1050/* Call hllDenseAdd() or hllSparseAdd() according to the HLL encoding. */
1051int hllAdd(robj *o, unsigned char *ele, size_t elesize) {
1052 struct hllhdr *hdr = o->ptr;
1053 switch(hdr->encoding) {
1054 case HLL_DENSE: return hllDenseAdd(hdr->registers,ele,elesize);
1055 case HLL_SPARSE: return hllSparseAdd(o,ele,elesize);
1056 default: return -1; /* Invalid representation. */
1057 }
1058}
1059
1060/* Merge by computing MAX(registers[i],hll[i]) the HyperLogLog 'hll'
1061 * with an array of uint8_t HLL_REGISTERS registers pointed by 'max'.

Callers 2

pfaddCommandFunction · 0.85
pfselftestCommandFunction · 0.85

Calls 2

hllDenseAddFunction · 0.85
hllSparseAddFunction · 0.85

Tested by

no test coverage detected