[ofw] [RFC] [PATCH 3/4] index list: new component to map quickly from an index to a pointer

Fab Tillier ftillier at windows.microsoft.com
Tue Apr 22 21:19:03 PDT 2008


>>>>+static void *IndexListRemoveFirst(INDEX_LIST *pIndexList)
>>>+{
>>>+       return IndexListRemove(pIndexList, pIndexList->pArray[0].Entry.Next);
>>>+}
>>
>>Doesn't this remove the last entry added to the index, not the first?
>
>I should rename this to IndexListRemoveHead(), since it removes the item at the
>head of the list.  It's only called to remove items during cleanup.

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. :)

-Fab



More information about the ofw mailing list