Skip to content

Commit

Permalink
Small cleanups in SQL/JSON code
Browse files Browse the repository at this point in the history
These are to keep Coverity happy. In one case remove a redundant NULL
check, and in another explicitly ignore a function result that is already
known.
  • Loading branch information
adunstan committed Apr 15, 2022
1 parent 5cd1c40 commit f7a605f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backend/parser/parse_expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3569,7 +3569,7 @@ coerceJsonFuncExpr(ParseState *pstate, Node *expr,
location = exprLocation(expr);

if (location < 0)
location = returning ? returning->format->location : -1;
location = returning->format->location;

/* special case for RETURNING bytea FORMAT json */
if (returning->format->format_type == JS_FORMAT_JSON &&
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/adt/jsonb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ JsonbUnquote(Jsonb *jb)
{
JsonbValue v;

JsonbExtractScalar(&jb->root, &v);
(void) JsonbExtractScalar(&jb->root, &v);

if (v.type == jbvString)
return pnstrdup(v.val.string.val, v.val.string.len);
Expand Down

0 comments on commit f7a605f

Please sign in to comment.