mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Eliminate unnecessary NULL checks in picksplit method of intarray.
Where these checks were being done there was no code path which could leave them NULL. Michael Paquier per Coverity
This commit is contained in:
parent
cb66f495f5
commit
c923e82a23
@ -416,8 +416,6 @@ g_int_picksplit(PG_FUNCTION_ARGS)
|
|||||||
size_waste = size_union - size_inter;
|
size_waste = size_union - size_inter;
|
||||||
|
|
||||||
pfree(union_d);
|
pfree(union_d);
|
||||||
|
|
||||||
if (inter_d != (ArrayType *) NULL)
|
|
||||||
pfree(inter_d);
|
pfree(inter_d);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -517,9 +515,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
|
|||||||
/* pick which page to add it to */
|
/* pick which page to add it to */
|
||||||
if (size_alpha - size_l < size_beta - size_r + WISH_F(v->spl_nleft, v->spl_nright, 0.01))
|
if (size_alpha - size_l < size_beta - size_r + WISH_F(v->spl_nleft, v->spl_nright, 0.01))
|
||||||
{
|
{
|
||||||
if (datum_l)
|
|
||||||
pfree(datum_l);
|
pfree(datum_l);
|
||||||
if (union_dr)
|
|
||||||
pfree(union_dr);
|
pfree(union_dr);
|
||||||
datum_l = union_dl;
|
datum_l = union_dl;
|
||||||
size_l = size_alpha;
|
size_l = size_alpha;
|
||||||
@ -528,9 +524,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (datum_r)
|
|
||||||
pfree(datum_r);
|
pfree(datum_r);
|
||||||
if (union_dl)
|
|
||||||
pfree(union_dl);
|
pfree(union_dl);
|
||||||
datum_r = union_dr;
|
datum_r = union_dr;
|
||||||
size_r = size_beta;
|
size_r = size_beta;
|
||||||
|
Loading…
Reference in New Issue
Block a user