Skip to content

Commit

Permalink
use the new NativeArray.create function
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Oct 13, 2016
1 parent be574a9 commit abfd40b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions std/Array.hx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ extern class Array<T> {
**/
@:runtime inline function map<S>( f : T -> S ) : Array<S> {
#if cpp
var result = [];
cpp.NativeArray.setSize(result, length);
var result = cpp.NativeArray.create(length);
for (i in 0...length) cpp.NativeArray.unsafeSet(result, i, f(cpp.NativeArray.unsafeGet(this, i)));
return result;
#else
Expand Down

0 comments on commit abfd40b

Please sign in to comment.