Optimization is a good thing to think about, but I doubt the cost of an "if" is much different than the cost of multiplying by zero. In fact, the multiplication might be cheaper, speed wise.

I...