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 @@ -99,6 +99,8 @@ static void uniqueifyJsonbObject(JsonbValue *object);
99
99
static JsonbValue * pushJsonbValueScalar (JsonbParseState * * pstate ,
100
100
JsonbIteratorToken seq ,
101
101
JsonbValue * scalarVal );
102
+ static JsonbValue * pushSingleScalarJsonbValue (JsonbParseState * * pstate ,
103
+ JsonbValue * jbval );
102
104
103
105
/*
104
106
* Turn an in-memory JsonbValue into a Jsonb for on-disk storage.
@@ -122,17 +124,7 @@ JsonbValueToJsonb(JsonbValue *val)
122
124
{
123
125
/* Scalar value */
124
126
JsonbParseState * pstate = NULL ;
125
- JsonbValue * res ;
126
- JsonbValue scalarArray ;
127
-
128
- scalarArray .type = jbvArray ;
129
- scalarArray .val .array .rawScalar = true;
130
- scalarArray .val .array .nElems = 1 ;
131
-
132
- pushJsonbValue (& pstate , WJB_BEGIN_ARRAY , & scalarArray );
133
- pushJsonbValue (& pstate , WJB_ELEM , val );
134
- res = pushJsonbValue (& pstate , WJB_END_ARRAY , NULL );
135
-
127
+ JsonbValue * res = pushSingleScalarJsonbValue (& pstate , val );
136
128
out = convertToJsonb (res );
137
129
}
138
130
else if (val -> type == jbvObject || val -> type == jbvArray )
You can’t perform that action at this time.
0 commit comments