File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ static void uniqueifyJsonbObject(JsonbValue *object);
105105static JsonbValue * pushJsonbValueScalar (JsonbParseState * * pstate ,
106106 JsonbIteratorToken seq ,
107107 JsonbValue * scalarVal );
108+ static JsonbValue * pushSingleScalarJsonbValue (JsonbParseState * * pstate ,
109+ JsonbValue * jbval );
108110
109111/*
110112 * Turn an in-memory JsonbValue into a Jsonb for on-disk storage.
@@ -128,17 +130,7 @@ JsonbValueToJsonb(JsonbValue *val)
128130 {
129131 /* Scalar value */
130132 JsonbParseState * pstate = NULL ;
131- JsonbValue * res ;
132- JsonbValue scalarArray ;
133-
134- scalarArray .type = jbvArray ;
135- scalarArray .val .array .rawScalar = true;
136- scalarArray .val .array .nElems = 1 ;
137-
138- pushJsonbValue (& pstate , WJB_BEGIN_ARRAY , & scalarArray );
139- pushJsonbValue (& pstate , WJB_ELEM , val );
140- res = pushJsonbValue (& pstate , WJB_END_ARRAY , NULL );
141-
133+ JsonbValue * res = pushSingleScalarJsonbValue (& pstate , val );
142134 out = convertToJsonb (res );
143135 }
144136 else if (val -> type == jbvObject || val -> type == jbvArray )
You can’t perform that action at this time.
0 commit comments