| 215 | |
| 216 | template<class T, class Key, class Hash> |
| 217 | inline void |
| 218 | Foam::HashTable<T, Key, Hash>::iteratorBase::increment() |
| 219 | { |
| 220 | // A negative index is a special value from erase |
| 221 | if (hashIndex_ < 0) |
| 222 | { |
| 223 | // the markPos='-curPos-1', but we wish to continue at 'curPos-1' |
| 224 | // thus use '-(markPos+1) -1' |
| 225 | hashIndex_ = -(hashIndex_+1) - 1; |
| 226 | } |
| 227 | else if (entryPtr_) |
| 228 | { |
| 229 | if (entryPtr_->next_) |
| 230 | { |
| 231 | // Move to next element on the SLList |
| 232 | entryPtr_ = entryPtr_->next_; |
| 233 | return; |
| 234 | } |
| 235 | } |
| 236 | // else |
| 237 | // { |
| 238 | // // if we reach here (entryPtr_ is nullptr) it is already at the end() |
| 239 | // // we should probably stop |
| 240 | // } |
| 241 | |
| 242 | |
| 243 | // Step to the next table entry |
| 244 | while |
| 245 | ( |
| 246 | ++hashIndex_ < hashTable_->tableSize_ |
| 247 | && !(entryPtr_ = hashTable_->table_[hashIndex_]) |
| 248 | ) |
| 249 | {} |
| 250 | |
| 251 | if (hashIndex_ >= hashTable_->tableSize_) |
| 252 | { |
| 253 | // make into an end iterator |
| 254 | entryPtr_ = 0; |
| 255 | hashIndex_ = 0; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | |
| 260 | template<class T, class Key, class Hash> |
no outgoing calls
no test coverage detected