simplify code: don't build up vector only to assert it is empty.