Fix variable shadowing warning

MSVC 14 gives the following warning:
"warning C4456: declaration of 'result' hides previous local declaration".