Skip to content

Commit 629f9fe

Browse files
committed
Fix post review comments regarding the usage of List<>.
1 parent 162ea7c commit 629f9fe

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

sql/sql_window.cc

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,31 +1527,27 @@ void add_extra_frame_cursors(List<Frame_cursor> *cursors,
15271527
}
15281528
}
15291529

1530-
List<Frame_cursor> get_window_func_required_cursors(
1531-
const Item_window_func* item_win)
1530+
void get_window_func_required_cursors(
1531+
List<Frame_cursor> *result, const Item_window_func* item_win)
15321532
{
1533-
List<Frame_cursor> result;
1534-
15351533
if (item_win->requires_partition_size())
1536-
result.push_back(new Frame_unbounded_following_set_count);
1534+
result->push_back(new Frame_unbounded_following_set_count);
15371535

15381536
/*
15391537
If it is not a regular window function that follows frame specifications,
15401538
specific cursors are required.
15411539
*/
15421540
if (item_win->is_frame_prohibited())
15431541
{
1544-
add_extra_frame_cursors(&result, item_win->window_func());
1545-
return result;
1542+
add_extra_frame_cursors(result, item_win->window_func());
1543+
return;
15461544
}
15471545

15481546
/* A regular window function follows the frame specification. */
1549-
result.push_back(get_frame_cursor(item_win->window_spec->window_frame,
1550-
false));
1551-
result.push_back(get_frame_cursor(item_win->window_spec->window_frame,
1552-
true));
1553-
1554-
return result;
1547+
result->push_back(get_frame_cursor(item_win->window_spec->window_frame,
1548+
false));
1549+
result->push_back(get_frame_cursor(item_win->window_spec->window_frame,
1550+
true));
15551551
}
15561552

15571553
/*
@@ -1600,7 +1596,8 @@ bool compute_window_func_with_frames(Item_window_func *item_win,
16001596
/* This algorithm doesn't support DISTINCT aggregator */
16011597
sum_func->set_aggregator(Aggregator::SIMPLE_AGGREGATOR);
16021598

1603-
List<Frame_cursor> cursors= get_window_func_required_cursors(item_win);
1599+
List<Frame_cursor> cursors;
1600+
get_window_func_required_cursors(&cursors, item_win);
16041601

16051602
List_iterator_fast<Frame_cursor> it(cursors);
16061603
Frame_cursor *c;

0 commit comments

Comments
 (0)