for (Enumeration e = list.elements(); e.hasMoreElements(); ) {
Object element = e.nextElement();
...
// might as well remove that to clean up the memory and make the list smaller ...
list.remove(element);
The lists would never be big either, usually no more than 2 or 3 elements, and probably never more than 5 or so. The elements in the list wouldn't be big either, generally being strings of less than 10 characters and probably never more than 100 characters. The entire list would probably get garbage collected at the same time as the elements in the list anyhow. That list.remove() caused problems and the motivation for doing it was silly.
No comments:
Post a Comment