> + * Builds a TreeHash based on a map of hashed chunks. > + * > + * @return The calculated TreeHash. > + * @see <a > href="http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html" > /> > + */ > + 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. > + ArrayList<HashCode> list = Lists.newArrayList(); > + for (Map.Entry<Integer, HashCode> entry : sortedMap.entrySet()) { > + list.add(entry.getValue()); > + } > + //The result list contains exactly one element now. > + return hashList(list).remove(0);
Do you need to mutate the list, or does `get(0)` do the same thing? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13825915
