MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Find

Method Find

Source/Engine/Core/Collections/ChunkedArray.h:423–436  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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
438public:
439 Iterator Begin() const

Callers

nothing calls this directly

Calls 1

CountMethod · 0.45

Tested by

no test coverage detected