This assumes the given iterator is in sorted order, so the first pair it gets will have the minimum hash. I'll add a comment.