diff --git a/src/main/java/io/vavr/collection/LinkedHashSet.java b/src/main/java/io/vavr/collection/LinkedHashSet.java index 92c5d60b2..dba6ebfbb 100644 --- a/src/main/java/io/vavr/collection/LinkedHashSet.java +++ b/src/main/java/io/vavr/collection/LinkedHashSet.java @@ -631,12 +631,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