On Wed, Dec 7, 2016 at 10:45 AM, Nadav Har'El <[email protected]> wrote:

>
> But even more importantly, since we already *have* wr, do we really need
> to search for
> it in list just to remove it from the list?
> I don't remember the details right now (please look into it), but I seem
> to remember that
> the boost-intrusive list we use is a doubly linked list, which means that
> given an item
> that we know must be in the list (wr), we can remove it from the list
> immediately, without
> firs finding it inside the list.
>

You should probably do this:

_waiters.erase(_waiters.iterator_to(wr));

Obviously, you're only allowed to use this iterator_to() when you are sure
the item is in the list - and when wr.waiter != nullptr, you are sure.
Also, as I said above, this iterator_to() is not only shorter code, it's
also faster (should be O(1) because of the doubly linked list). If I
remember correctly :-)

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to