diff options
author | unknown <igor@rurik.mysql.com> | 2004-10-09 10:34:13 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2004-10-09 10:34:13 -0700 |
commit | 881534fb80cc7a017d180734a21a10b3e46aecba (patch) | |
tree | 84324c7af32f54d423310e3a2ee3255f7f43749b /sql/sql_list.h | |
parent | 79f1eeb87ff8047d1d09578f41c604bf5e31f29b (diff) | |
parent | 75fec5bdc3e9e5f0a4018c7dbf6371f0b4c5d14f (diff) | |
download | mariadb-git-881534fb80cc7a017d180734a21a10b3e46aecba.tar.gz |
Merge for Item_equal.
BitKeeper/etc/ignore:
auto-union
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/heap_btree.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
mysql-test/t/range.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/sql_list.h:
Auto merged
mysql-test/r/func_test.result:
Post-automerge resolution of conflicts
mysql-test/r/index_merge.result:
Post-automerge resolution of conflicts
mysql-test/r/join_outer.result:
Post-automerge resolution of conflicts
mysql-test/r/range.result:
Post-automerge resolution of conflicts
mysql-test/r/subselect.result:
Post-automerge resolution of conflicts
sql/item.cc:
Post-automerge resolution of conflicts
sql/item.h:
Post-automerge resolution of conflicts
sql/item_cmpfunc.cc:
Post-automerge resolution of conflicts
sql/item_cmpfunc.h:
Post-automerge resolution of conflicts
sql/opt_range.cc:
Post-automerge resolution of conflicts
sql/sql_select.cc:
Post-automerge resolution of conflicts
sql/sql_select.h:
Post-automerge resolution of conflicts
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r-- | sql/sql_list.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h index a4379b74c17..40530314893 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -127,10 +127,12 @@ public: void remove(list_node **prev) { list_node *node=(*prev)->next; - delete *prev; - *prev=node; if (!--elements) last= &first; + else if (last == &(*prev)->next) + last= prev; + delete *prev; + *prev=node; } inline void *pop(void) { @@ -143,9 +145,36 @@ public: } inline void concat(base_list *list) { - *last= list->first; - last= list->last; - elements+= list->elements; + if (!list->is_empty()) + { + *last= list->first; + last= list->last; + elements+= list->elements; + } + } + inline void disjoin(base_list *list) + { + list_node **prev= &first; + list_node *node= first; + list_node *list_first= list->first; + elements=0; + while (node && node != list_first) + { + prev= &node->next; + node= node->next; + elements++; + } + *prev= *last; + last= prev; + } + inline void prepand(base_list *list) + { + if (!list->is_empty()) + { + *list->last= first; + first= list->first; + elements+= list->elements; + } } inline list_node* last_node() { return *last; } inline list_node* first_node() { return first;} @@ -257,6 +286,9 @@ public: inline T* head() {return (T*) base_list::head(); } inline T** head_ref() {return (T**) base_list::head_ref(); } inline T* pop() {return (T*) base_list::pop(); } + inline void concat(List<T> *list) { base_list::concat(list); } + inline void disjoin(List<T> *list) { base_list::disjoin(list); } + inline void prepand(List<T> *list) { base_list::prepand(list); } void delete_elements(void) { list_node *element,*next; @@ -267,7 +299,6 @@ public: } empty(); } - inline void concat(List<T> *list) { base_list::concat(list); } }; @@ -278,6 +309,8 @@ public: inline T* operator++(int) { return (T*) base_list_iterator::next(); } inline T *replace(T *a) { return (T*) base_list_iterator::replace(a); } inline T *replace(List<T> &a) { return (T*) base_list_iterator::replace(a); } + inline void rewind(void) { base_list_iterator::rewind(); } + inline void remove() { base_list_iterator::remove(); } inline void after(T *a) { base_list_iterator::after(a); } inline T** ref(void) { return (T**) base_list_iterator::ref(); } }; |