On 2/26/18 3:26 PM, Martin Buchholz wrote:


    Looks okay.  I also think no need to have a separate
    copyToArrayDeque method and just inline in the constructor.


It's used twice.  Also, it's likely to be replaced someday when we decide what to do with lambdas, so good to keep as a separate method.

The first use can be replaced with very simple code:

ArrayList<URL> path = new ArrayList<>(urls.length);
ArrayDeque<T> unopenedUrls = new ArrayDeque<>(urls.length);
for (URL url : urls) {
    path.add(url);
    unopenedUrls.add(url);
}

Mandy

Reply via email to