Aether.java Useless collection
amihaiemil opened this issue Β· comments
In constructor public Aether(final Collection<RemoteRepository> repos, final File repo)
:
Why is the intermediary rlist
Collection needed? Currently rlist
is populated and then transformed into an array to be stored in this.remotes
. Can't we simply declare this.remotes = new Repository[repos.size()];
at the beginning and then add items in the for loop, like this this.remotes[idx++] = new Repository(remote)
?
@yegor256 can you have a look here pls? Thanks
@yegor256 ping
@yegor256 Don't forget about this pls
@amihaiemil this is very cosmetic. also, making the changes you're suggesting won't really make less lines in this ctor. also, will make this.remotes
very mutable, which is technically OK, but not how we want to think about it