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

Commit5d3f7c5

Browse files
committed
Remove dead code in nodeGatherMerge.c.
Coverity noted that the last line of gather_merge_getnext() wasunreachable, since each arm of the preceding "if" ends in a "return".Drop it as an oversight. In passing, improve some nearby comments.
1 parentce38949 commit5d3f7c5

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

‎src/backend/executor/nodeGatherMerge.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ gather_merge_init(GatherMergeState *gm_state)
423423
}
424424

425425
/*
426-
* Clear outa slot inthe tuple table for each gather merge
427-
*slotand returnthe clear cleared slot.
426+
* Clear out the tuple tableslotsfor each gather merge input,
427+
* and returna cleared slot.
428428
*/
429429
staticTupleTableSlot*
430430
gather_merge_clear_slots(GatherMergeState*gm_state)
@@ -456,19 +456,21 @@ gather_merge_getnext(GatherMergeState *gm_state)
456456
{
457457
inti;
458458

459-
/*
460-
* First time through: pull the first tuple from each participate, and set
461-
* up the heap.
462-
*/
463-
if (gm_state->gm_initialized== false)
459+
if (!gm_state->gm_initialized)
460+
{
461+
/*
462+
* First time through: pull the first tuple from each participant, and
463+
* set up the heap.
464+
*/
464465
gather_merge_init(gm_state);
466+
}
465467
else
466468
{
467469
/*
468470
* Otherwise, pull the next tuple from whichever participant we
469-
* returned from last time, and reinserttheindex into the heap,
470-
* because it might now compare differently against the existing
471-
* elements of the heap.
471+
* returned from last time, and reinsertthat participant'sindex into
472+
*the heap,because it might now compare differently against the
473+
*otherelements of the heap.
472474
*/
473475
i=DatumGetInt32(binaryheap_first(gm_state->gm_heap));
474476

@@ -485,11 +487,10 @@ gather_merge_getnext(GatherMergeState *gm_state)
485487
}
486488
else
487489
{
490+
/* Return next tuple from whichever participant has the leading one */
488491
i=DatumGetInt32(binaryheap_first(gm_state->gm_heap));
489492
returngm_state->gm_slots[i];
490493
}
491-
492-
returngather_merge_clear_slots(gm_state);
493494
}
494495

495496
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp