diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-04-04 14:16:15 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-04-04 22:04:18 +0300 |
commit | 629f9feabe699a6d0d378355674c4b4d16fdcf64 (patch) | |
tree | f892a94723f998d059329ae7bc10ceed5056f374 /sql/sql_window.cc | |
parent | 162ea7c0cf91bb701b9004780a7a106fff2ecc9d (diff) | |
download | mariadb-git-629f9feabe699a6d0d378355674c4b4d16fdcf64.tar.gz |
Fix post review comments regarding the usage of List<>.
Diffstat (limited to 'sql/sql_window.cc')
-rw-r--r-- | sql/sql_window.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sql/sql_window.cc b/sql/sql_window.cc index bb95627ceae..ff2f5a46449 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -1527,13 +1527,11 @@ void add_extra_frame_cursors(List<Frame_cursor> *cursors, } } -List<Frame_cursor> get_window_func_required_cursors( - const Item_window_func* item_win) +void get_window_func_required_cursors( + List<Frame_cursor> *result, const Item_window_func* item_win) { - List<Frame_cursor> result; - if (item_win->requires_partition_size()) - result.push_back(new Frame_unbounded_following_set_count); + result->push_back(new Frame_unbounded_following_set_count); /* If it is not a regular window function that follows frame specifications, @@ -1541,17 +1539,15 @@ List<Frame_cursor> get_window_func_required_cursors( */ if (item_win->is_frame_prohibited()) { - add_extra_frame_cursors(&result, item_win->window_func()); - return result; + add_extra_frame_cursors(result, item_win->window_func()); + return; } /* A regular window function follows the frame specification. */ - result.push_back(get_frame_cursor(item_win->window_spec->window_frame, - false)); - result.push_back(get_frame_cursor(item_win->window_spec->window_frame, - true)); - - return result; + result->push_back(get_frame_cursor(item_win->window_spec->window_frame, + false)); + result->push_back(get_frame_cursor(item_win->window_spec->window_frame, + true)); } /* @@ -1600,7 +1596,8 @@ bool compute_window_func_with_frames(Item_window_func *item_win, /* This algorithm doesn't support DISTINCT aggregator */ sum_func->set_aggregator(Aggregator::SIMPLE_AGGREGATOR); - List<Frame_cursor> cursors= get_window_func_required_cursors(item_win); + List<Frame_cursor> cursors; + get_window_func_required_cursors(&cursors, item_win); List_iterator_fast<Frame_cursor> it(cursors); Frame_cursor *c; |