Просмотр исходного кода

[cpp] Split vector creation from setting the size

Hugh 11 лет назад
Родитель
Сommit
b529584fa8
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      std/haxe/ds/Vector.hx

+ 2 - 1
std/haxe/ds/Vector.hx

@@ -65,7 +65,8 @@ abstract Vector<T>(VectorData<T>) {
 		#elseif java
 			this = new java.NativeArray(length);
 		#elseif cpp
-			this = untyped (new Array<T>()).__SetSizeExact(length);
+			this = new Array<T>();
+			untyped this.__SetSizeExact(length);
 		#elseif python
 			this = python.Syntax.pythonCode("[{0}]*{1}", null, length);
 		#else