Skip to content

Commit

Permalink
Merge pull request #363 from restorer/patch-2
Browse files Browse the repository at this point in the history
Fix ByteArray resizing for js target
  • Loading branch information
jgranick committed Mar 4, 2015
2 parents d6f1c98 + 7926f05 commit f88a35f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lime/utils/ByteArray.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
#if js
if (allocated < value)
___resizeBuffer (allocated = Std.int (Math.max (value, allocated * 2)));
else if (allocated > value)
else if (allocated > value * 2)
___resizeBuffer (allocated = value);
length = value;
#end
Expand Down Expand Up @@ -1160,4 +1160,4 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa

#else
typedef ByteArray = flash.utils.ByteArray;
#end
#end

0 comments on commit f88a35f

Please sign in to comment.