You can check if `state->state` is 0 before doing this since you only need to do it once per enumeration.