Low level function to set the dense HLL register at 'index' to the * specified value if the current value is smaller than 'count'. * * 'registers' is expected to have room for HLL_REGISTERS plus an * additional byte on the right. This requirement is met by sds strings * automatically since they are implicitly null terminated. * * The function always succeed, however if as a result of the op
| 493 | * the approximated cardinality changed, 1 is returned. Otherwise 0 |
| 494 | * is returned. */ |
| 495 | int hllDenseSet(uint8_t *registers, long index, uint8_t count) { |
| 496 | uint8_t oldcount; |
| 497 | |
| 498 | HLL_DENSE_GET_REGISTER(oldcount,registers,index); |
| 499 | if (count > oldcount) { |
| 500 | HLL_DENSE_SET_REGISTER(registers,index,count); |
| 501 | return 1; |
| 502 | } else { |
| 503 | return 0; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | /* "Add" the element in the dense hyperloglog data structure. |
| 508 | * Actually nothing is added, but the max 0 pattern counter of the subset |
no outgoing calls
no test coverage detected