unit_map::unit_iterator unit_map::begin() { // This call just needs to go somewhere that is likely to be // called when num_iters_ == 0. This seems as good a place as any. clean_invalid(); umap::iterator i = map_.begin(); while (i != map_.end() && !is_valid(i)) { ++i; } return unit_iterator(i, this); }
unit_map::unit_iterator unit_map::begin() { // clean if there are more invalid than valid, this block just needs to go somewhere that is likely to be // called when num_iters_ == 0. This seems as good a place as any. if (num_invalid_ > lmap_.size() && num_iters_ == 0) { clean_invalid(); } umap::iterator i = map_.begin(); while (i != map_.end() && !i->second.first) { ++i; } return unit_iterator(i, this); }