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

Method LocateArray

storage/connect/jsonudf.cpp:911–929  ·  view source on GitHub ↗

/ Locate in a JSON Array. */ /

Source from the content-addressed store, hash-verified

909/* Locate in a JSON Array. */
910/*********************************************************************************/
911my_bool JSNX::LocateArray(PGLOBAL g, PJAR jarp)
912{
913 char s[16];
914 size_t m = Jp->N;
915
916 for (int i = 0; i < jarp->size() && !Found; i++) {
917 Jp->N = m;
918 snprintf(s, sizeof(s), "[%d]", i + B);
919
920 if (Jp->WriteStr(s))
921 return true;
922
923 if (LocateValue(g, jarp->GetArrayValue(i)))
924 return true;
925
926 } // endfor i
927
928 return false;
929} // end of LocateArray
930
931/*********************************************************************************/
932/* Locate in a JSON Object. */

Callers

nothing calls this directly

Calls 3

WriteStrMethod · 0.80
sizeMethod · 0.45
GetArrayValueMethod · 0.45

Tested by

no test coverage detected