Jaan Pullerits
Nov 7 · 1 min read

I have to say this is not something one should be worried about. First of all, compiler will not create the code for this return value anyway, as it is not used. And even if you assign the return value to variable in the code, it wouldn’t “use additional memory”, the value has to be loaded into register anyway for the addition operation, it’s just the order how they are stored back to variables changes. There is no performance or memory impact whatsoever.

    Jaan Pullerits

    Written by

    Software developer, music producer, amateur photographer and all the other things I find interesting at a time.