| 218 | // Check whether index i is in the set. |
| 219 | template<typename Value> |
| 220 | bool SparseSetT<Value>::contains(int i) const { |
| 221 | assert(i >= 0); |
| 222 | assert(i < max_size()); |
| 223 | if (static_cast<uint32_t>(i) >= static_cast<uint32_t>(max_size())) { |
| 224 | return false; |
| 225 | } |
| 226 | // Unsigned comparison avoids checking sparse_[i] < 0. |
| 227 | return (uint32_t)sparse_[i] < (uint32_t)size_ && |
| 228 | dense_[sparse_[i]] == i; |
| 229 | } |
| 230 | |
| 231 | template<typename Value> |
| 232 | void SparseSetT<Value>::create_index(int i) { |
no test coverage detected