Truncate a LinkedList

Weijun Wang weijun.wang at oracle.com
Tue Feb 19 10:27:33 UTC 2013


Hi All

I'm using LinkedList to maintain a history and the elements are ordered 
by their timestamps. Every now and then I would "expunge" the list, that 
is to say, iterating through the list and when an element is old enough 
all elements after (and including) it will be removed. Currently I'm 
removing them one by one.

Is there a way to truncate the list using a single method?

Thanks
Max



More information about the core-libs-dev mailing list