From 7732d49ca211571552bf82b5207deed95c0cc09c Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Sun, 11 Oct 2015 23:53:35 -0400 Subject: 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. --- src/backend/utils/adt/jsonb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/jsonb.c') 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) { -- cgit v1.2.3