
8 Nov
2007
8 Nov
'07
7:28 p.m.
Dan Smith wrote:
Instead of filling another list, and then copying it back, why not just make a copy of the incoming list and then copy matching instances back to the original? Something like this:
struct inst_list tmp_list;
tmp_list = *list; inst_list_init(list);
for (items in tmp_list) { if (item is resultclass) inst_list_add(list, item); }
inst_list_free(tmp_list);
That should work, and only copy the needed instance pointers once, instead of running through the list twice.
Excellent suggestion! Thanks, this works. Will generate another patch. -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com