Explorar el Código

Store array of strings

Hugh Sanderson hace 12 años
padre
commit
339a4b5d8d
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      std/cpp/_std/StringBuf.hx

+ 5 - 5
std/cpp/_std/StringBuf.hx

@@ -22,26 +22,26 @@
 @:coreApi
 class StringBuf {
 
-	private var b : Array<Dynamic>;
+	private var b : Array<String>;
 
 	public function new() : Void {
 		b = new Array();
 	}
 
 	public inline function add( x : Dynamic ) : Void {
-		b[b.length] = x;
+		b.push(x);
 	}
 
 	public inline function addSub( s : String, pos : Int, ?len : Int ) : Void {
-		b[b.length] = s.substr(pos,len);
+		b.push(s.substr(pos,len));
 	}
 
 	public inline function addChar( c : Int ) : Void untyped {
-		b[b.length] = String.fromCharCode(c);
+		b.push(String.fromCharCode(c));
 	}
 
 	public inline function toString() : String {
 		return b.join("");
 	}
 
-}
+}