On weak topology for optimal control of switched nonlinear systems