Fix Cppcheck warning. Use reference to avoid redundant data-copy