diff options
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r-- | sql/sql_list.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h index c27ed44cb9c..47590920510 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -311,10 +311,13 @@ public: */ inline void swap(base_list &rhs) { + list_node **rhs_last=rhs.last; swap_variables(list_node *, first, rhs.first); - swap_variables(list_node **, last, rhs.last); swap_variables(uint, elements, rhs.elements); + rhs.last= last == &first ? &rhs.first : last; + last = rhs_last == &rhs.first ? &first : rhs_last; } + inline list_node* last_node() { return *last; } inline list_node* first_node() { return first;} inline void *head() { return first->info; } |