Merge branch 'Lab3' into Lab4
This commit is contained in:
commit
56a45d4ae1
@ -54,12 +54,11 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
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[i] = obj;
|
||||
return true;
|
||||
}
|
||||
_collection[index] = obj;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user