Author: fejj
Date: 2007-09-04 13:04:37 -0400 (Tue, 04 Sep 2007)
New Revision: 85309

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/list.cpp
Log:
2007-09-04  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * list.cpp (Insert): Fixed.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-09-04 16:47:38 UTC (rev 85308)
+++ trunk/moon/src/ChangeLog    2007-09-04 17:04:37 UTC (rev 85309)
@@ -1,5 +1,7 @@
 2007-09-04  Jeffrey Stedfast  <[EMAIL PROTECTED]>
 
+       * list.cpp (Insert): Fixed.
+
        * runtime.cpp (render_cb): Added some "FPS" debug spew.
 
        * media.cpp (AdvanceFrame): On MediaEnded, don't remove the source

Modified: trunk/moon/src/list.cpp
===================================================================
--- trunk/moon/src/list.cpp     2007-09-04 16:47:38 UTC (rev 85308)
+++ trunk/moon/src/list.cpp     2007-09-04 17:04:37 UTC (rev 85309)
@@ -134,19 +134,24 @@
                }
                
                if (i == index) {
-                       if (n == tail)
-                               tail = node;
-                       
-                       n->prev->next = node;
+                       // Inserting @node before @n
                        node->prev = n->prev;
                        node->next = n;
+                       
+                       if (n->prev)
+                               n->prev->next = node;
+                       else
+                               head = node;
+                       
                        n->prev = node;
                } else {
+                       // Inserting @node after @n (means @n was the tail)
                        tail = n->next = node;
                        node->prev = n;
                        node->next = 0;
                }
        } else {
+               // @node will be the only node in the list
                head = tail = node;
                node->next = 0;
                node->prev = 0;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to