On Sun, 18 Mar 2001, Mysidia wrote: > Oh.. you're actually extracting every beat, so the character >will only remain for a fraction of a second, and doing everything >else the same I can't imagine that breaking anything; the only thing >evil about it is the scroll through the entire player list, needing >to extract a character is IMO a thing common enough to warrant creation >of its own list, [...] If I kept track of a 'prev' pointer, this method would make list removals even faster than the REMOVE_FROM_LIST macro that is currently used by extract_char_final. I decided I didn't want to duplicate that code at the moment. We used to have: O(n) * extractions Now we have: O(n) + O(n) * extractions We could have (with 'prev' pointer): O(n) + O(1) * extractions >... the cost of that, depends on how many characters there are in the >game, but it would seem to warrant the tradeoff of adding a variable. Read my comment in the code: + * Q: Why do we leave them on the character_list? + * A: Because code doing 'vict = vict->next' would + * get really confused otherwise. -- George Greer | If it's about the CircleMUD mailing list, greerga@circlemud.org | mail owner-circle@post.queensu.ca instead. -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/04/01 PST