Skip to content

Commit

Permalink
Actual faster LinkedHashSet tail (#2726)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
j-baker authored and pivovarit committed Aug 19, 2024
1 parent 86d1bf3 commit ba9ed24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vavr/src/main/java/io/vavr/collection/LinkedHashSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ public LinkedHashSet<T> tail() {
if (map.isEmpty()) {
throw new UnsupportedOperationException("tail of empty set");
}
return remove(head());
return wrap(map.tail());
}

@Override
Expand Down

0 comments on commit ba9ed24

Please # to comment.