Pass parameter by reference

First pull request :)
This change contains just a minor performance enhancement by passing a const parameter by reference in 2 functions