[residual] Remove unused code in find_residual