Skip to content

Commit 8c9565b

Browse files
sleepytomcatdanieldietrich
authored andcommitted
Vector.of(T element) performance improvement (#2659)
1 parent 67713d6 commit 8c9565b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static <T> Collector<T, ArrayList<T>, Vector<T>> collector() {
111111
* @return A new Vector instance containing the given element
112112
*/
113113
public static <T> Vector<T> of(T element) {
114-
return ofAll(Iterator.of(element));
114+
return ofAll(BitMappedTrie.ofAll(new Object[]{element}));
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)