summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Grittner2015-02-16 21:26:23 +0000
committerKevin Grittner2015-02-16 21:26:23 +0000
commitc923e82a231ebfe7c4329984c68819e26837bee6 (patch)
tree16082a232826c99d343a8ed43f742919805bb256
parentcb66f495f5d0c204f051971f2c549d5c3ac850ea (diff)
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
-rw-r--r--contrib/intarray/_int_gist.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c
index 53abcc45a5..876a7b9a8a 100644
--- a/contrib/intarray/_int_gist.c
+++ b/contrib/intarray/_int_gist.c
@@ -416,9 +416,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
size_waste = size_union - size_inter;
pfree(union_d);
-
- if (inter_d != (ArrayType *) NULL)
- pfree(inter_d);
+ pfree(inter_d);
/*
* are these a more promising split that what we've already seen?
@@ -517,10 +515,8 @@ g_int_picksplit(PG_FUNCTION_ARGS)
/* 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 (datum_l)
- pfree(datum_l);
- if (union_dr)
- pfree(union_dr);
+ pfree(datum_l);
+ pfree(union_dr);
datum_l = union_dl;
size_l = size_alpha;
*left++ = i;
@@ -528,10 +524,8 @@ g_int_picksplit(PG_FUNCTION_ARGS)
}
else
{
- if (datum_r)
- pfree(datum_r);
- if (union_dl)
- pfree(union_dl);
+ pfree(datum_r);
+ pfree(union_dl);
datum_r = union_dr;
size_r = size_beta;
*right++ = i;