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

Function NewLimitOp

src/execution_plan/ops/op_limit.c:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39OpBase *NewLimitOp(const ExecutionPlan *plan, AR_ExpNode *limit_exp) {
40 // validate inputs
41 ASSERT(plan != NULL);
42 ASSERT(limit_exp != NULL);
43
44 OpLimit *op = rm_malloc(sizeof(OpLimit));
45 op->limit = 0;
46 op->consumed = 0;
47 op->limit_exp = NULL;
48
49 _eval_limit(op, limit_exp);
50
51 // set operations
52 OpBase_Init((OpBase *)op, OPType_LIMIT, "Limit", NULL, LimitConsume, LimitReset, NULL,
53 LimitClone, LimitFree, false, plan);
54
55 return (OpBase *)op;
56}
57
58static Record LimitConsume(OpBase *opBase) {
59 OpLimit *op = (OpLimit *)opBase;

Callers 2

LimitCloneFunction · 0.85
buildLimitOpFunction · 0.85

Calls 3

rm_mallocFunction · 0.85
_eval_limitFunction · 0.85
OpBase_InitFunction · 0.85

Tested by

no test coverage detected