Fix a performance warning from cppcheck.