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 authored and danieldietrich committed Jul 14, 2021
1 parent 67713d6 commit 8c9565b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vavr/src/main/java/io/vavr/collection/Vector.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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 8c9565b

Please sign in to comment.