simplified
do not spend so long time figuring it out, just ask me to clarify next time. i've already been grateful.
First
GetKey(l.GetIndex())
is (almost) the same as
~l
(but AFAIK, l.GetIndex can return -1, which will crash here).
Second, I start to realize the problem. Yes, "GetIndex" in fact searches for the first key that is equal. Solution is simple - do not put equal keys into DropList
You can solve your problem by adding separate mapping array (keys are then indicies to this array).