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-12 10:10:51 -0400
commitf75c4fc1dc93d60246df324bf595912d557bcba6 (patch)
tree4d06642c358c1e1956db01d13aa6cd6e58bbea4a /src/backend/utils/adt/jsonb.c
parent7109c606d00f972359052bb8c8879a1ecfc1850f (diff)
downloadpostgresql-f75c4fc1dc93d60246df324bf595912d557bcba6.tar.gz
postgresql-f75c4fc1dc93d60246df324bf595912d557bcba6.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)
{