Talk:CoroutineScheduler

From Unify Community Wiki
Revision as of 01:40, 18 April 2011 by Bunny83 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RemoveCoroutine

You have some redundancy in your RemoveCoroutine function. If you're not the head of the list (you are not the first) there have to be a previous node. So it could be simplified to:

<javascript>

 if (first == coroutine) { // remove first
     first = coroutine.listNext;
 } else { // not head of list
     coroutine.listPrevious.listNext = coroutine.listNext;
     if (coroutine.listNext != null) { // we have a successor
         coroutine.listNext.listPrevious = coroutine.listPrevious;
     }
 }

</javascript>

However, really nice example, i think that will help beginners a lot. Too bad you can't upvote in the wiki ;) --Bunny83 18:40, 17 April 2011 (PDT)

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox