| 141 | |
| 142 | private: |
| 143 | iterator InsertInternal(bool allow_existing, int i) { |
| 144 | DebugCheckInvariants(); |
| 145 | if (static_cast<uint32_t>(i) >= static_cast<uint32_t>(max_size())) { |
| 146 | assert(false && "illegal index"); |
| 147 | // Semantically, end() would be better here, but we already know |
| 148 | // the user did something stupid, so begin() insulates them from |
| 149 | // dereferencing an invalid pointer. |
| 150 | return begin(); |
| 151 | } |
| 152 | if (!allow_existing) { |
| 153 | assert(!contains(i)); |
| 154 | create_index(i); |
| 155 | } else { |
| 156 | if (!contains(i)) |
| 157 | create_index(i); |
| 158 | } |
| 159 | DebugCheckInvariants(); |
| 160 | return dense_.data() + sparse_[i]; |
| 161 | } |
| 162 | |
| 163 | // Add the index i to the set. |
| 164 | // Only use if contains(i) is known to be false. |
nothing calls this directly
no test coverage detected