Jelajahi Sumber

[js] make EReg constructor inline as in some cases (like replace) we can fully inline the EReg object

Dan Korostelev 9 tahun lalu
induk
melakukan
7716640220
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      std/js/_std/EReg.hx

+ 2 - 3
std/js/_std/EReg.hx

@@ -23,9 +23,8 @@
 
 	var r : HaxeRegExp;
 
-	public function new( r : String, opt : String ) : Void {
-		opt = opt.split("u").join(""); // 'u' (utf8) depends on page encoding
-		this.r = new HaxeRegExp(r, opt);
+	public inline function new( r : String, opt : String ) : Void {
+		this.r = new HaxeRegExp(r, opt.split("u").join("")); // 'u' (utf8) depends on page encoding
 	}
 
 	public function match( s : String ) : Bool {