> +    * 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();
> +      while (i.hasNext())
> +         q.offer(i.next().getValue());
> +
> +      //Rehash the queue until its size is 1.
> +      while (q.size() > 1)

Duplicated below; factor into a helper method?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13791887

Reply via email to