diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2014-06-18 19:28:20 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2014-06-18 19:28:20 -0400 |
commit | 960661980beb50c5d21e4b2855ae109e9a130326 (patch) | |
tree | 7783bad880335f46dada1082912d3bc1e337144b /src/backend/utils/adt/jsonb_util.c | |
parent | 66802246e22d51858cd543877fcfddf24e6812f2 (diff) | |
download | postgresql-960661980beb50c5d21e4b2855ae109e9a130326.tar.gz postgresql-960661980beb50c5d21e4b2855ae109e9a130326.zip |
Remove unnecessary check for jbvBinary in convertJsonbValue.
The check was confusing and is a condition that should never in fact
happen.
Per gripe from Dmitry Dolgov.
Diffstat (limited to 'src/backend/utils/adt/jsonb_util.c')
-rw-r--r-- | src/backend/utils/adt/jsonb_util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c index 93bb148232e..04f35bfffc9 100644 --- a/src/backend/utils/adt/jsonb_util.c +++ b/src/backend/utils/adt/jsonb_util.c @@ -1314,7 +1314,14 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level) if (!val) return; - if (IsAJsonbScalar(val) || val->type == jbvBinary) + /* + * A JsonbValue passed as val should never have a type of jbvBinary, + * and neither should any of its sub-components. Those values will be + * produced by convertJsonbArray and convertJsonbObject, the results of + * which will not be passed back to this function as an argument. + */ + + if (IsAJsonbScalar(val)) convertJsonbScalar(buffer, header, val); else if (val->type == jbvArray) convertJsonbArray(buffer, header, val, level); |