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

Function Map_Clone

src/datatypes/map.c:78–93  ·  view source on GitHub ↗

clone map

Source from the content-addressed store, hash-verified

76
77// clone map
78SIValue Map_Clone
79(
80 SIValue map // map to clone
81) {
82 ASSERT(SI_TYPE(map) & T_MAP);
83
84 uint key_count = Map_KeyCount(map);
85 SIValue clone = Map_New(key_count);
86
87 for(uint i = 0; i < key_count; i++) {
88 Pair p = map.map[i];
89 Map_Add(&clone, p.key, p.val);
90 }
91
92 return clone;
93}
94
95// adds key/value to map
96void Map_Add

Callers 2

SI_CloneValueFunction · 0.85
AR_MERGEMAPFunction · 0.85

Calls 3

Map_KeyCountFunction · 0.85
Map_NewFunction · 0.85
Map_AddFunction · 0.85

Tested by

no test coverage detected