]> git.saurik.com Git - cycript.git/blobdiff - List.hpp
Refactor CYSetLast to return a reference to the eol.
[cycript.git] / List.hpp
index 92d64e11d3bd1a7444b955b594037bb35683417e..f4762f224875a291ffdffaad9cb30b20995de0ec 100644 (file)
--- a/List.hpp
+++ b/List.hpp
@@ -42,14 +42,14 @@ struct CYNext {
 };
 
 template <typename Type_>
-void CYSetLast(Type_ *&list, Type_ *item) {
+Type_ *&CYLast(Type_ *&list) {
     if (list == NULL)
-        list = item;
+        return list;
     else {
         Type_ *next(list);
         while (next->next_ != NULL)
             next = next->next_;
-        next->next_ = item;
+        return next->next_;
     }
 }