Hey.
I have a for loop. Inside that for loop I pass a point to a function. The point is made from two integer values that are part of (declared and initialised inside) the for loop. I have the option to either create a point before the loop and then assign its x and y values manually each iteration:
or construct a point each iteration from the two values:Code:point.x = x; point.y = y; some_func(point);Premature optimisation aside, this is a question that I have asked myself many times before and I think it's time I chose the right option instead of wasting energy each time it happens pondering which is faster.Code:some_func(point(x, y));
Thanks!




Reply With Quote