MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / map

Method map

include/Array.h:1286–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284template<typename ELEM_>
1285template<class TO>
1286Array<TO> Array_obj<ELEM_>::map(MappingFunc<TO> inFunc)
1287{
1288 auto result = Array_obj<TO>::__new(length, 0);
1289 for (int i = 0; i < length; i++)
1290 result->__unsafe_set(i, inFunc(__unsafe_get(i)));
1291 return result;
1292}
1293#else
1294template<typename ELEM_>
1295cpp::VirtualArray Array_obj<ELEM_>::map(MappingFunc inFunc)

Callers 1

_hx_runMethod · 0.45

Calls 3

__newFunction · 0.85
__unsafe_getFunction · 0.85
__unsafe_setMethod · 0.80

Tested by

no test coverage detected