Skip to content

Commit ba9ed24

Browse files
j-bakerpivovarit
authored andcommitted
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 86d1bf3 commit ba9ed24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ public LinkedHashSet<T> tail() {
841841
if (map.isEmpty()) {
842842
throw new UnsupportedOperationException("tail of empty set");
843843
}
844-
return remove(head());
844+
return wrap(map.tail());
845845
}
846846

847847
@Override

0 commit comments

Comments
 (0)