Merge branch 'Lab3' into Lab4
This commit is contained in:
commit
56a45d4ae1
@ -54,13 +54,12 @@ 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…
Reference in New Issue
Block a user