Browse Source

[php] fix performance of haxe.io.Bytes.set() (closes #8938)

Aleksandr Kuzmenko 5 years ago
parent
commit
1c8bb6a63f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/php/_std/haxe/io/BytesData.hx

+ 1 - 1
std/php/_std/haxe/io/BytesData.hx

@@ -49,7 +49,7 @@ private abstract BytesDataAbstract(Container) from Container to Container {
 
 
 	@:arrayAccess
 	@:arrayAccess
 	public inline function set(index:Int, val:Int):Void {
 	public inline function set(index:Int, val:Int):Void {
-		this.s = Global.substr_replace(this.s, Global.chr(val), index, 1);
+		this.s[index] = Global.chr(val);
 	}
 	}
 
 
 	public inline function compare(other:BytesDataAbstract):Int {
 	public inline function compare(other:BytesDataAbstract):Int {