> + result.offer(q.poll());
> + return result;
> + }
> +
> + /**
> + * Build a TreeHash based on a map of hashed chunks.
> + *
> + * @return The calculated TreeHash.
> + */
> + public static HashCode buildTreeHashFromMap(Map<Integer, HashCode> map) {
> + //Sort the Map with the hash parts.
> + SortedMap<Integer, HashCode> sortedMap =
> ImmutableSortedMap.copyOf(map);
> +
> + //Convert the strings and add them to our queue.
> + Queue<HashCode> q = Lists.newLinkedList();
> + Iterator<Map.Entry<Integer, HashCode>> i =
> sortedMap.entrySet().iterator();
Better to write this with a for-each loop?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13791857