> > Sorry, still not getting what you want to say. > > Mayb ethere is some confusion regarding what .idx actually is? .idx is
Yes, it proved that I was wrong, that patch is right only and only when both items' idx is NULL, this apparently not the case. Please ignore that patch, thanks for your time. -- Thanks, Chengwei > supposed to point to some index integer that is stored in the actual > structure the user added to the priority queue and that can be used to > quickly remove an entry from the priority queue without requiring it to > be the first one. > > In the swap() call we hence first swap the the data and idx pointers > themselves, and then in a second step we finally update what the idx > pointers actually point to to the new index of the item in our priority > queue. > > I totally don't see how any of that was redundant. We must make sure > after all that after the swap: > > a) For both entries we know that the data pointer has been swapped > b) For both entries we know that the pointer to the index value that is part > of the user structure has been swapped > c) For both entries we know that the index value that is part of the user > structure has been swapped > > Lennart > > -- > Lennart Poettering, Red Hat > _______________________________________________ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
signature.asc
Description: Digital signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel