diff --git a/vavr/src/main/java/io/vavr/collection/LinkedHashSet.java b/vavr/src/main/java/io/vavr/collection/LinkedHashSet.java index d6bfc505b..865bc5d98 100644 --- a/vavr/src/main/java/io/vavr/collection/LinkedHashSet.java +++ b/vavr/src/main/java/io/vavr/collection/LinkedHashSet.java @@ -641,12 +641,12 @@ public T head() { if (map.isEmpty()) { throw new NoSuchElementException("head of empty set"); } - return iterator().next(); + return map.head()._1(); } @Override public Option headOption() { - return iterator().headOption(); + return map.headOption().map(Tuple2::_1); } @Override