MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / AR_DISTINCT

Function AR_DISTINCT

src/arithmetic/conditional_funcs/conditional_funcs.c:81–85  ·  view source on GitHub ↗

Distinct maintains a set of values, if value `X` already in the set return NULL, otherwise `X` is returned and added to to the set.

Source from the content-addressed store, hash-verified

79// if value `X` already in the set return NULL,
80// otherwise `X` is returned and added to to the set.
81SIValue AR_DISTINCT(SIValue *argv, int argc, void *private_data) {
82 set *set = private_data;
83 if(Set_Add(set, argv[0])) return SI_TransferOwnership(argv);
84 return SI_NullVal();
85}
86
87// Routine for freeing a Distinct function context.
88void Distinct_Free(void *ctx_ptr) {

Callers

nothing calls this directly

Calls 3

Set_AddFunction · 0.85
SI_TransferOwnershipFunction · 0.85
SI_NullValFunction · 0.85

Tested by

no test coverage detected