1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

cleanup: reduce indentation of end_send

Reorder end_send to exit via return instead of large if-else block.
This commit is contained in:
Vicențiu Ciorbaru
2020-12-28 18:27:09 +02:00
parent d624464b50
commit d028fb9ffa

View File

@@ -21943,8 +21943,7 @@ join_read_next_same_or_null(READ_RECORD *info)
/* ARGSUSED */ /* ARGSUSED */
static enum_nested_loop_state static enum_nested_loop_state
end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), end_send(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
bool end_of_records)
{ {
DBUG_ENTER("end_send"); DBUG_ENTER("end_send");
/* /*
@@ -21956,8 +21955,13 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
//TODO pass fields via argument //TODO pass fields via argument
List<Item> *fields= join_tab ? (join_tab-1)->fields : join->fields; List<Item> *fields= join_tab ? (join_tab-1)->fields : join->fields;
if (!end_of_records) if (end_of_records)
{ {
if (join->procedure && join->procedure->end_of_records())
DBUG_RETURN(NESTED_LOOP_ERROR);
DBUG_RETURN(NESTED_LOOP_OK);
}
if (join->table_count && if (join->table_count &&
join->join_tab->is_using_loose_index_scan()) join->join_tab->is_using_loose_index_scan())
{ {
@@ -22049,12 +22053,6 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
*/ */
DBUG_RETURN(NESTED_LOOP_CURSOR_LIMIT); DBUG_RETURN(NESTED_LOOP_CURSOR_LIMIT);
} }
}
else
{
if (join->procedure && join->procedure->end_of_records())
DBUG_RETURN(NESTED_LOOP_ERROR);
}
DBUG_RETURN(NESTED_LOOP_OK); DBUG_RETURN(NESTED_LOOP_OK);
} }
@@ -22069,8 +22067,7 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
*/ */
enum_nested_loop_state enum_nested_loop_state
end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), end_send_group(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
bool end_of_records)
{ {
int idx= -1; int idx= -1;
enum_nested_loop_state ok_code= NESTED_LOOP_OK; enum_nested_loop_state ok_code= NESTED_LOOP_OK;