MCPcopy Create free account
hub / github.com/MariaDB/server / AddArrayValue

Method AddArrayValue

storage/connect/json.cpp:1322–1351  ·  view source on GitHub ↗

/ Add a Value to the Array Value list. */ /

Source from the content-addressed store, hash-verified

1320/* Add a Value to the Array Value list. */
1321/***********************************************************************/
1322PJVAL JARRAY::AddArrayValue(PGLOBAL g, PJVAL jvp, int *x)
1323{
1324 if (!jvp)
1325 jvp = new(g) JVALUE;
1326
1327 if (x) {
1328 int i = 0, n = *x;
1329 PJVAL jp, *jpp = &First;
1330
1331 for (jp = First; jp && i < n; i++, jp = *(jpp = &jp->Next));
1332
1333 (*jpp) = jvp;
1334
1335 if (!(jvp->Next = jp))
1336 Last = jvp;
1337
1338 } else {
1339 if (!First)
1340 First = jvp;
1341 else if (Last == First)
1342 First->Next = Last = jvp;
1343 else
1344 Last->Next = jvp;
1345
1346 Last = jvp;
1347 Last->Next = NULL;
1348 } // endif x
1349
1350 return jvp;
1351} // end of AddValue
1352
1353/***********************************************************************/
1354/* Merge two arrays. */

Callers 15

ParseArrayMethod · 0.45
GetKeyListMethod · 0.45
GetValListMethod · 0.45
bson_make_arrayFunction · 0.45
bson_array_add_valuesFunction · 0.45
bson_array_addFunction · 0.45
bson_array_grp_addFunction · 0.45
bbin_make_arrayFunction · 0.45
bbin_array_addFunction · 0.45
bbin_array_add_valuesFunction · 0.45
MakeJsonMethod · 0.45
GetRowMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected