Skip to content

Commit

Permalink
Vector.of(T element) performance improvement (#2659)
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepytomcat committed May 16, 2021
1 parent a09f8cc commit 665aa9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/vavr/collection/Vector.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static <T> Collector<T, ArrayList<T>, Vector<T>> collector() {
* @return A new Vector instance containing the given element
*/
public static <T> Vector<T> of(T element) {
return ofAll(Iterator.of(element));
return ofAll(BitMappedTrie.ofAll(new Object[]{element}));
}

/**
Expand Down

0 comments on commit 665aa9f

Please sign in to comment.