main-coverity-ZdcAnalysis
remove large stack use (create fitter on the heap instead, using unique_ptr) and tidy code locally. Also remove redundant check.
Edited by Shaun Roe
remove large stack use (create fitter on the heap instead, using unique_ptr) and tidy code locally. Also remove redundant check.