summaryrefslogtreecommitdiffstats
path: root/core/self_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/self_list.h')
-rw-r--r--core/self_list.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/self_list.h b/core/self_list.h
index 9edf735f7b..e229d5bf8e 100644
--- a/core/self_list.h
+++ b/core/self_list.h
@@ -51,6 +51,25 @@ public:
_first->_prev = p_elem;
_first = p_elem;
}
+ void add_last(SelfList<T> *p_elem) {
+
+ ERR_FAIL_COND(p_elem->_root);
+
+ if (!_first) {
+ add(p_elem);
+ return;
+ }
+
+ SelfList<T> *e = _first;
+
+ while (e->next()) {
+ e = e->next();
+ }
+
+ e->_next = p_elem;
+ p_elem->_prev = e->_next;
+ p_elem->_root = this;
+ }
void remove(SelfList<T> *p_elem) {