Skip to content

Commit 24ebac4

Browse files
authored
Actual faster LinkedHashSet tail (#2726)
My profuse apologies - in the last PR I somehow realised and then forgot that LinkedHashSet tail doesn't actually use LinkedHashMap tail. This remedies that.
1 parent 7e2911f commit 24ebac4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/vavr/collection/LinkedHashSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ public LinkedHashSet<T> tail() {
831831
if (map.isEmpty()) {
832832
throw new UnsupportedOperationException("tail of empty set");
833833
}
834-
return remove(head());
834+
return wrap(map.tail());
835835
}
836836

837837
@Override

0 commit comments

Comments
 (0)