Searches for the specified object and returns the zero-based index of the first occurrence within the entire collection. The item to find. The zero-based index of the first occurrence of itm within the entire collection, if found; otherwise, INVALID_INDEX.
| 421 | /// <param name="item">The item to find.</param> |
| 422 | /// <returns>The zero-based index of the first occurrence of itm within the entire collection, if found; otherwise, INVALID_INDEX.</returns> |
| 423 | int32 Find(const T& item) const |
| 424 | { |
| 425 | int32 startIndex = 0; |
| 426 | for (int32 chunkIndex = 0; chunkIndex < _chunks.Count(); chunkIndex++) |
| 427 | { |
| 428 | const int32 index = _chunks[chunkIndex]->Find(item); |
| 429 | if (index != INVALID_INDEX) |
| 430 | return startIndex + index; |
| 431 | startIndex += ChunkSize; |
| 432 | if (startIndex > _count) |
| 433 | break; |
| 434 | } |
| 435 | return INVALID_INDEX; |
| 436 | } |
| 437 | |
| 438 | public: |
| 439 | Iterator Begin() const |