Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 31cc64c

Browse files
author
Nikita Glukhov
committed
Simplify jsonStatsInit()
1 parent 0490567 commit 31cc64c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/utils/adt/jsonb_selfuncs.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ jsonStatsInit(JsonStats data, const VariableStatData *vardata)
8181
Jsonb *jb;
8282
JsonbValue prefix;
8383

84-
memset(&data->attslot, 0, sizeof(data->attslot));
85-
data->statsTuple = vardata->statsTuple;
86-
87-
/* FIXME Could be before the memset, I guess? Checking vardata->statsTuple. */
88-
if (!data->statsTuple)
84+
if (!vardata->statsTuple)
8985
return false;
9086

87+
data->statsTuple = vardata->statsTuple;
88+
memset(&data->attslot, 0, sizeof(data->attslot));
89+
9190
/* Were there just NULL values in the column? No JSON stats, but still useful. */
9291
if (((Form_pg_statistic) GETSTRUCT(data->statsTuple))->stanullfrac >= 1.0)
9392
{

0 commit comments

Comments
 (0)