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
109111void
110112JsonbToJsonbValue (Jsonb * jsonb , JsonbValue * val )
@@ -135,17 +137,7 @@ JsonbValueToJsonb(JsonbValue *val)
135137 {
136138 /* Scalar value */
137139 JsonbParseState * pstate = NULL ;
138- JsonbValue * res ;
139- JsonbValue scalarArray ;
140-
141- scalarArray .type = jbvArray ;
142- scalarArray .val .array .rawScalar = true;
143- scalarArray .val .array .nElems = 1 ;
144-
145- pushJsonbValue (& pstate , WJB_BEGIN_ARRAY , & scalarArray );
146- pushJsonbValue (& pstate , WJB_ELEM , val );
147- res = pushJsonbValue (& pstate , WJB_END_ARRAY , NULL );
148-
140+ JsonbValue * res = pushSingleScalarJsonbValue (& pstate , val );
149141 out = convertToJsonb (res );
150142 }
151143 else if (val -> type == jbvObject || val -> type == jbvArray )
You can’t perform that action at this time.
0 commit comments