Keeping in mind this similar question does C#/Roslyn omit multiplication by 1 in cases where a variable is hard coded to 1? The similar question's answers suggest Roslyn would convert var x = 5 * 1
to var x = 5
at compile time, but I wonder if this holds true for a more complex example.
Example:
var baseAmount = 25.10M;
var multiplier = 1;
var total = baseAmount * multiplier; // does this become just "baseAmount"?
Ultimately I am trying to determine if adding * 1 or an equivalent will result in performance impacts at scale (code hit millions of times). Being explicit and verbose with the * 1 multiplication in this case would result in more readable, "self-commenting" code for people new to the codebase.