Fix performance warning reported by MSVC