1
NGUI 3 Support / about BetterList.Contains
« on: February 18, 2014, 03:12:24 AM »
We are on NGUI2.6.1, to me the following code is problematic:
public bool Contains (T item)
{
if (buffer == null) return false;
for (int i = 0; i < size; ++i) if (buffer.Equals(item)) return true;
return false;
}
It assumes that buffer is not null but what if buffer is destroyed outside?
In this case, we will want to figure out why we destroy materials when there is reference to them. But at the same time, we don't want it crash the app for release build.
Anyone has comments on this?
Best,
Raven
public bool Contains (T item)
{
if (buffer == null) return false;
for (int i = 0; i < size; ++i) if (buffer.Equals(item)) return true;
return false;
}
It assumes that buffer is not null but what if buffer is destroyed outside?
In this case, we will want to figure out why we destroy materials when there is reference to them. But at the same time, we don't want it crash the app for release build.
Anyone has comments on this?
Best,
Raven