MotionPlanner: small optimization in fetching next command