| 208 | |
| 209 | private: |
| 210 | iterator SetInternal(bool allow_existing, int i, const Value& v) { |
| 211 | DebugCheckInvariants(); |
| 212 | if (static_cast<uint32_t>(i) >= static_cast<uint32_t>(max_size())) { |
| 213 | assert(false && "illegal index"); |
| 214 | // Semantically, end() would be better here, but we already know |
| 215 | // the user did something stupid, so begin() insulates them from |
| 216 | // dereferencing an invalid pointer. |
| 217 | return begin(); |
| 218 | } |
| 219 | if (!allow_existing) { |
| 220 | assert(!has_index(i)); |
| 221 | create_index(i); |
| 222 | } else { |
| 223 | if (!has_index(i)) |
| 224 | create_index(i); |
| 225 | } |
| 226 | return SetExistingInternal(i, v); |
| 227 | } |
| 228 | |
| 229 | iterator SetExistingInternal(int i, const Value& v) { |
| 230 | DebugCheckInvariants(); |
nothing calls this directly
no test coverage detected