文档

Unity Engine

Unity Engine

Find

Find a sequence of N contiguous 0 bits in a bit array. To achieve higher performance, it is not guaranteed that the found index is necessarily the first occurrence of such a sequence.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

Find(int, int)

Find a sequence of N contiguous 0 bits in a bit array. To achieve higher performance, it is not guaranteed that the found index is necessarily the first occurrence of such a sequence.
public int Find(int pos, int numBits)

Parameters

pos

Index at which to start searching.

numBits

Number of contiguous 0 bits to look for.

Returns

Type

Description

intThe index in this array where the sequence is found. The index will be greater than or equal to
pos
. Returns -1 if no occurrence is found.

Remarks

The search does not guarantee the earliest occurrence in the array.

Find(int, int, int)

Find a sequence of N contiguous 0 bits in a bit array. To achieve higher performance, it is not guaranteed that the found index is necessarily the first occurrence of such a sequence.
public int Find(int pos, int count, int numBits)

Parameters

pos

Index at which to start searching.

count

Number of bits to search.

numBits

Number of contiguous 0 bits to look for.

Returns

Type

Description

intThe index in this array where the sequence is found. The index will be greater than or equal to
pos
but less than
pos + count
. Returns -1 if no occurrence is found.

Remarks

The search does not guarantee the earliest occurrence in the array.