File tree 1 file changed +3
-11
lines changed
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
/*
110
112
* Turn an in-memory JsonbValue into a Jsonb for on-disk storage.
@@ -128,17 +130,7 @@ JsonbValueToJsonb(JsonbValue *val)
128
130
{
129
131
/* Scalar value */
130
132
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 );
142
134
out = convertToJsonb (res );
143
135
}
144
136
else if (val -> type == jbvObject || val -> type == jbvArray )
You can’t perform that action at this time.
0 commit comments