Merge pull request #363 from restorer/patch-2
Fix ByteArray resizing for js target
This commit is contained in:
@@ -1131,7 +1131,7 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
|
|||||||
#if js
|
#if js
|
||||||
if (allocated < value)
|
if (allocated < value)
|
||||||
___resizeBuffer (allocated = Std.int (Math.max (value, allocated * 2)));
|
___resizeBuffer (allocated = Std.int (Math.max (value, allocated * 2)));
|
||||||
else if (allocated > value)
|
else if (allocated > value * 2)
|
||||||
___resizeBuffer (allocated = value);
|
___resizeBuffer (allocated = value);
|
||||||
length = value;
|
length = value;
|
||||||
#end
|
#end
|
||||||
@@ -1160,4 +1160,4 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
typedef ByteArray = flash.utils.ByteArray;
|
typedef ByteArray = flash.utils.ByteArray;
|
||||||
#end
|
#end
|
||||||
|
|||||||
Reference in New Issue
Block a user