Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc923e82

Browse files
committed
Eliminate unnecessary NULL checks in picksplit method of intarray.
Where these checks were being done there was no code path whichcould leave them NULL.Michael Paquier per Coverity
1 parentcb66f49 commitc923e82

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

‎contrib/intarray/_int_gist.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,7 @@ g_int_picksplit(PG_FUNCTION_ARGS)
416416
size_waste=size_union-size_inter;
417417

418418
pfree(union_d);
419-
420-
if (inter_d!= (ArrayType*)NULL)
421-
pfree(inter_d);
419+
pfree(inter_d);
422420

423421
/*
424422
* are these a more promising split that what we've already seen?
@@ -517,21 +515,17 @@ g_int_picksplit(PG_FUNCTION_ARGS)
517515
/* pick which page to add it to */
518516
if (size_alpha-size_l<size_beta-size_r+WISH_F(v->spl_nleft,v->spl_nright,0.01))
519517
{
520-
if (datum_l)
521-
pfree(datum_l);
522-
if (union_dr)
523-
pfree(union_dr);
518+
pfree(datum_l);
519+
pfree(union_dr);
524520
datum_l=union_dl;
525521
size_l=size_alpha;
526522
*left++=i;
527523
v->spl_nleft++;
528524
}
529525
else
530526
{
531-
if (datum_r)
532-
pfree(datum_r);
533-
if (union_dl)
534-
pfree(union_dl);
527+
pfree(datum_r);
528+
pfree(union_dl);
535529
datum_r=union_dr;
536530
size_r=size_beta;
537531
*right++=i;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp