[ofw] [RFC] [PATCH 3/4] index list: new component to map quickly from an index to a pointer
Sean Hefty
sean.hefty at intel.com
Tue Apr 22 21:30:46 PDT 2008
>I don't think that the Head/Tail concept applies well here because there's no
>indication when you insert whether you're inserting at the head or tail. You
>could rename Insert to Push, and RemoveFirst to Pop as the function is closer
>to a stack than a list. Or you could name it
>IndexListRemoveEntryThatWasInsertedLast. :)
I changed it to IndexListRemoveHead().
There is a doubly-linked list that's being maintained, and the item being
removed is at the head of that list. It's not necessarily the item that was
inserted last, but whatever item ended up at the head. Since items can be
removed in the middle of the list, it doesn't match the behavior of a stack.
Now, if you want to argue that IndexListInsert() would be better named
IndexListInsertHead()...
- Sean
More information about the ofw
mailing list