> + while (hashList.size() > 1) {
> + //Hash pairs of values and add them to the result list.
> + for (Iterator<HashCode> it = hashList.iterator(); it.hasNext();)
> {
> + HashCode hc1 = it.next();
> + if (it.hasNext()) {
> + HashCode hc2 = it.next();
> + result.add(Hashing.sha256().newHasher()
> + .putBytes(hc1.asBytes())
> + .putBytes(hc2.asBytes())
> + .hash());
> + } else {
> + result.add(hc1);
> + }
> + }
> + hashList = result;
> + result = Lists.newArrayList();
Does not really matter in this case, but generally we prefer immutable objects
which eliminate some sources of bugs, e.g., thread-safety.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13878902