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);
105
105
static JsonbValue * pushJsonbValueScalar (JsonbParseState * * pstate ,
106
106
JsonbIteratorToken seq ,
107
107
JsonbValue * scalarVal );
108
+ static JsonbValue * pushSingleScalarJsonbValue (JsonbParseState * * pstate ,
109
+ JsonbValue * jbval );
108
110
109
111
void
110
112
JsonbToJsonbValue (Jsonb * jsonb , JsonbValue * val )
@@ -135,17 +137,7 @@ JsonbValueToJsonb(JsonbValue *val)
135
137
{
136
138
/* Scalar value */
137
139
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 );
149
141
out = convertToJsonb (res );
150
142
}
151
143
else if (val -> type == jbvObject || val -> type == jbvArray )
You can’t perform that action at this time.
0 commit comments