r/programminghumor • u/Bubbly_Rain7858 • Jun 13 '26
How to REALLY optimize code.
My friends, this is how you optimize code correctly.
97
Upvotes
r/programminghumor • u/Bubbly_Rain7858 • Jun 13 '26
My friends, this is how you optimize code correctly.
View all comments
Show parent comment
8
u/realmauer01 Jun 14 '26
It shouldn't if the variable is already considered as not constant.
That being said, it just does nothing.
The idea behind it is that it "ensures" that the compiler looks ahead and repalces every path where the variable is actually const already. While it obviously cant do that on paths where it isnt. Funnily enough that is standard behavior already, no matter if a variable is const or not.