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

Function _process_yield

src/procedures/proc_sp_paths.c:89–118  ·  view source on GitHub ↗

initialize returned values pointers

Source from the content-addressed store, hash-verified

87
88// initialize returned values pointers
89static void _process_yield
90(
91 SinglePairCtx *ctx,
92 const char **yield
93) {
94 ctx->yield_path = NULL;
95 ctx->yield_path_weight = NULL;
96 ctx->yield_path_cost = NULL;
97
98 int idx = 0;
99 for(uint i = 0; i < array_len(yield); i++) {
100 if(strcasecmp("path", yield[i]) == 0) {
101 ctx->yield_path = ctx->output + idx;
102 idx++;
103 continue;
104 }
105
106 if(strcasecmp("pathWeight", yield[i]) == 0) {
107 ctx->yield_path_weight = ctx->output + idx;
108 idx++;
109 continue;
110 }
111
112 if(strcasecmp("pathCost", yield[i]) == 0) {
113 ctx->yield_path_cost = ctx->output + idx;
114 idx++;
115 continue;
116 }
117 }
118}
119
120// make sure context level array have 'cap' available entries.
121static void _SinglePairCtx_EnsureLevelArrayCap

Callers 1

Proc_SPpathsInvokeFunction · 0.70

Calls 1

array_lenFunction · 0.85

Tested by

no test coverage detected