Skip to content

Commit 665aa9f

Browse files
authored
Vector.of(T element) performance improvement (#2659)
1 parent a09f8cc commit 665aa9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static <T> Collector<T, ArrayList<T>, Vector<T>> collector() {
102102
* @return A new Vector instance containing the given element
103103
*/
104104
public static <T> Vector<T> of(T element) {
105-
return ofAll(Iterator.of(element));
105+
return ofAll(BitMappedTrie.ofAll(new Object[]{element}));
106106
}
107107

108108
/**

0 commit comments

Comments
 (0)