Small optimization to avoid unnecessary square roots.
Merge pull request #1881 from davebaol/sqrt

Small optimization to avoid unnecessary square roots.