изменил вставку
This commit is contained in:
parent
e5df4eb3e6
commit
8ae53d9903
@ -54,12 +54,11 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
public bool Insert(T obj)
|
public bool Insert(T obj)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < _collection.Length; i++)
|
int index = Array.IndexOf(_collection, null);
|
||||||
|
if(index >= 0)
|
||||||
{
|
{
|
||||||
if (_collection[i] == null) {
|
_collection[index] = obj;
|
||||||
_collection[i] = obj;
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user