Call hllDenseAdd() or hllSparseAdd() according to the HLL encoding. */
| 1049 | |
| 1050 | /* Call hllDenseAdd() or hllSparseAdd() according to the HLL encoding. */ |
| 1051 | int 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'. |
no test coverage detected