Gile, I'm amazed that you try to help, cause that is a good deed, not found regulary, and i feel somewhat guilt because of that, but I feel that you have not read carefully enough, OR it was me to blame that I have put way too mouch text and too little code, and in this way may have misguided you. However I have pointed almost every time that I'm really intereseted in a FASTER ways of finding list of add objects, and removed objects:
need to remove the ones not currently in selection and add the new ones
I need something like "objects added to selection" and "objects moved from selection"
Now, rembember - i needed "add list" and "remove list".
The thing about code I posted is that it is oversimplified so it can be easier to understand, with everything needed to know is that I really needed 2 lists: added and removed objects. I admit that this is not a good design, but this code is a relict from acad 2008 and I don't have the time RIGHT NOW to rewrite new, since it works. The list at the end you see is actually far more complex and does heavy handleing of hooking events, reading initial values, notifing other interesed parties hooked to its own events... basically holder for all the objects. So if you (in this scenario) do make "list = anything" - this means - forget everything, reset list, and let all the items, like baloons with cut strings to go to the roof and left waiting for garbage collector, and we know this cannot be done safely in ACAD.
The first listing you posted is fast, but it does "=" thing.
The last one you posted is about the same fast as the code I posted as "my final" (this also runs about 1 sec on 10000 objs) but yours is cleaner, and thus better. But since "add items" is also somewhat expensive, I guess that if we had a separate list of only removed items, and added items, it would run fastest. My goal was to make it in linq.
to ilustrate: the actions are
form LIST1 (of type in this case, user selected object ids)
1) add items to MYLIST(of different type) (if this item is not already here), and let list perform "action" on every new later in bulk mode (not seen in this code)
2) remove items from MYLIST, not found in LIST1 (but not the ones we would like to keep), and let list perform "actions" in bulk mode