Does it make the program slower if we declare & define a lambda multiple times within a loop? I am using the lambda on each iteration of the loop, but instead of declaring the lambda outside, I am declaring the lambda on each iteration as well. Would this make the program slower?
hey, can you please respond?
Small stuff like that usually is too small to matter (it might also just get optimized by the compiler). I’d consider focusing on the overall complexity of the program instead if you’re trying to optimize your code.