fred
fred copied to clipboard
Replace Java 1.4 era 'for' loops
Use Enhanced 'for' loops
While the enhanced for loops are nice, I would suggest to actually go one step further and use the Stream API, e.g.
buckets.stream().forEach(Bucket::free);
Of course that’s only possible in places where the method being called does not throw exceptions…
If you're following Bombe's suggestion, please consider leaving out the .stream() (just using Iterable's forEach(Consumer)):
buckets.forEach(Bucket::free);
@Bombe could you review this one ?