+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12

Thread: The Linked List Container

  1. #11
    Join Date
    Mar 2005
    Location
    California
    Posts
    2,097

    Default

    Doh! I just realized there's a bug inherent in this set of classes. If you take an element of a list and add it to a different list (or the same list) you will break the original list. The pointers will no longer be correct.

    I'm going to have to add some checks to deal with this. Otherwise it could easily lead to engine crashes.
    "They laughed when I said I was going to be a comedian ... They're not laughing now." - Bob Monkhouse

  2. #12
    Join Date
    Mar 2005
    Location
    California
    Posts
    2,097

    Default

    Alright guys, I've fixed the class to deal with the case where an element is added when that element is already a member of a list (either the list it is being added to or another one, doesn't matter). The element is simply removed from its old container before being added to the new one.

    While I was at it, I added a GetNextNode() and GetPreviousNode() to the node class. That should (once again) complete these classes for the moment.

    I went ahead and updated the engine docs.
    "They laughed when I said I was going to be a comedian ... They're not laughing now." - Bob Monkhouse

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts