Prechádzať zdrojové kódy

[cpp] Split vector creation from setting the size

Hugh 11 rokov pred
rodič
commit
b529584fa8
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  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