|
|
|
@@ -293,7 +293,7 @@ public: |
|
|
|
@param newObject the new object to add to the array
|
|
|
|
@see set, insert, addIfNotAlreadyThere, addSorted, addArray
|
|
|
|
*/
|
|
|
|
void add (ObjectClass* const newObject) noexcept
|
|
|
|
ObjectClass* add (ObjectClass* const newObject) noexcept
|
|
|
|
{
|
|
|
|
const ScopedLockType lock (getLock());
|
|
|
|
data.ensureAllocatedSize (numUsed + 1);
|
|
|
|
@@ -302,6 +302,8 @@ public: |
|
|
|
|
|
|
|
if (newObject != nullptr)
|
|
|
|
newObject->incReferenceCount();
|
|
|
|
|
|
|
|
return newObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Inserts a new object into the array at the given index.
|
|
|
|
@@ -317,8 +319,8 @@ public: |
|
|
|
@param newObject the new object to add to the array
|
|
|
|
@see add, addSorted, addIfNotAlreadyThere, set
|
|
|
|
*/
|
|
|
|
void insert (int indexToInsertAt,
|
|
|
|
ObjectClass* const newObject) noexcept
|
|
|
|
ObjectClass* insert (int indexToInsertAt,
|
|
|
|
ObjectClass* const newObject) noexcept
|
|
|
|
{
|
|
|
|
if (indexToInsertAt >= 0)
|
|
|
|
{
|
|
|
|
@@ -342,10 +344,12 @@ public: |
|
|
|
newObject->incReferenceCount();
|
|
|
|
|
|
|
|
++numUsed;
|
|
|
|
|
|
|
|
return newObject;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
add (newObject);
|
|
|
|
return add (newObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|