@@ -247,7 +247,6 @@ static void JsonValueListInitIterator(const JsonValueList *jvl,
247
247
static JsonbValue * JsonValueListNext (const JsonValueList * jvl ,
248
248
JsonValueListIterator * it );
249
249
static int JsonbType (JsonbValue * jb );
250
- static JsonbValue * JsonbInitBinary (JsonbValue * jbv , Jsonb * jb );
251
250
static int JsonbType (JsonbValue * jb );
252
251
static JsonbValue * getScalar (JsonbValue * scalar , enum jbvType type );
253
252
static JsonbValue * wrapItemsInArray (const JsonValueList * items );
@@ -646,7 +645,7 @@ executeJsonPath(JsonPath *path, Jsonb *vars, Jsonb *json, bool throwErrors,
646
645
jspInit (& jsp , path );
647
646
648
647
if (!JsonbExtractScalar (& json -> root , & jbv ))
649
- JsonbInitBinary (& jbv , json );
648
+ JsonValueInitBinary (& jbv , JsonRoot ( json ) );
650
649
651
650
if (vars && !JsonContainerIsObject (& vars -> root ))
652
651
{
@@ -2119,7 +2118,7 @@ executeKeyValueMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
2119
2118
2120
2119
jsonb = JsonbValueToJsonb (keyval );
2121
2120
2122
- JsonbInitBinary (& obj , jsonb );
2121
+ JsonValueInitBinary (& obj , JsonRoot ( jsonb ) );
2123
2122
2124
2123
baseObject = setBaseObject (cxt , & obj , cxt -> lastGeneratedObjectId ++ );
2125
2124
@@ -2238,7 +2237,7 @@ getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable,
2238
2237
pnstrdup (varName , varNameLength ))));
2239
2238
}
2240
2239
2241
- JsonbInitBinary (& tmp , vars );
2240
+ JsonValueInitBinary (& tmp , JsonRoot ( vars ) );
2242
2241
setBaseObject (cxt , & tmp , 1 );
2243
2242
}
2244
2243
@@ -2617,18 +2616,6 @@ JsonValueListNext(const JsonValueList *jvl, JsonValueListIterator *it)
2617
2616
return result ;
2618
2617
}
2619
2618
2620
- /*
2621
- * Initialize a binary JsonbValue with the given jsonb container.
2622
- */
2623
- static JsonbValue *
2624
- JsonbInitBinary (JsonbValue * jbv , Jsonb * jb )
2625
- {
2626
- jbv -> type = jbvBinary ;
2627
- jbv -> val .binary .data = & jb -> root ;
2628
-
2629
- return jbv ;
2630
- }
2631
-
2632
2619
/*
2633
2620
* Returns jbv* type of JsonbValue. Note, it never returns jbvBinary as is.
2634
2621
*/
0 commit comments