aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonb.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-10-11 23:53:35 -0400
committerNoah Misch <noah@leadboat.com>2015-10-11 23:53:35 -0400
commit7732d49ca211571552bf82b5207deed95c0cc09c (patch)
tree6076ea33201132e5b850f5a4ae4cc51f7430bc8e /src/backend/utils/adt/jsonb.c
parentf20b26960ae62a3ffd12782eea09e0e9c23a2ac1 (diff)
downloadpostgresql-7732d49ca211571552bf82b5207deed95c0cc09c.tar.gz
postgresql-7732d49ca211571552bf82b5207deed95c0cc09c.zip
Use JsonbIteratorToken consistently in automatic variable declarations.
Many functions stored JsonbIteratorToken values in variables of other integer types. Also, standardize order relative to other declarations. Expect compilers to generate the same code before and after this change.
Diffstat (limited to 'src/backend/utils/adt/jsonb.c')
-rw-r--r--src/backend/utils/adt/jsonb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c
index 8fef35ea38a..8b1cab488bb 100644
--- a/src/backend/utils/adt/jsonb.c
+++ b/src/backend/utils/adt/jsonb.c
@@ -455,8 +455,8 @@ JsonbToCStringWorker(StringInfo out, JsonbContainer *in, int estimated_len, bool
{
bool first = true;
JsonbIterator *it;
- JsonbIteratorToken type = WJB_DONE;
JsonbValue v;
+ JsonbIteratorToken type = WJB_DONE;
int level = 0;
bool redo_switch = false;
@@ -899,7 +899,6 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
case JSONBTYPE_JSONB:
{
Jsonb *jsonb = DatumGetJsonb(val);
- JsonbIteratorToken type;
JsonbIterator *it;
it = JsonbIteratorInit(&jsonb->root);
@@ -913,6 +912,8 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
}
else
{
+ JsonbIteratorToken type;
+
while ((type = JsonbIteratorNext(&it, &jb, false))
!= WJB_DONE)
{