UnityEngine.Graphics.DynamicArray FindIndex has a bug

When I was reviewing the source code of Unity Graphics C#, I discovered this bug:


The parameter “count” in this method has not been utilized.
I think the correct way of writing it should be like this? :

		public int FindIndex(int startIndex, int count, Predicate<T> match)
		{
			for (int i = startIndex; i < size && count > 0; ++i, --count)
			{
				if (match(m_Array[i]))
				{
					return i;
				}
			}
			return -1;
		}
1 Like

I think you are correct. You should file a bug!

If you have a bug, there is only one way to report it.

Help → Report A Bug.

Report one bug at a time with all the expected supporting information attached.

1 Like

Thanks!
I sent the bug report to Unity as you said, and they have received and replied to me