Explorar o código

[cpp] Split vector creation from setting the size

Hugh %!s(int64=11) %!d(string=hai) anos
pai
achega
b529584fa8
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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