Profiling of iterator open/reset/close

Is there a case when theState is not set? If not, I think you should make it an assertion: assert(theState);