You don’t need a generated function for this. See: Seemingly unnecessary allocation within for loop - #8 by stevengj