Browse Source

allow inlining of StringBuf objects

Dan Korostelev 11 years ago
parent
commit
2d197cb941
1 changed files with 4 additions and 2 deletions
  1. 4 2
      std/StringBuf.hx

+ 4 - 2
std/StringBuf.hx

@@ -32,7 +32,7 @@
 **/
 **/
 class StringBuf {
 class StringBuf {
 
 
-	var b:String = "";
+	var b:String;
 
 
 	/**
 	/**
 		The length of `this` StringBuf in characters.
 		The length of `this` StringBuf in characters.
@@ -44,7 +44,9 @@ class StringBuf {
 
 
 		This may involve initialization of the internal buffer.
 		This may involve initialization of the internal buffer.
 	**/
 	**/
-	public function new() {}
+	public inline function new() {
+		b = "";
+	}
 
 
 	inline function get_length() : Int {
 	inline function get_length() : Int {
 		return b.length;
 		return b.length;