1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Minor clean-ups.

This commit is contained in:
jules 2013-07-01 08:31:09 +01:00
parent fdca8fe1c0
commit 899b1253da
2 changed files with 9 additions and 4 deletions

View file

@ -728,6 +728,7 @@ public:
if (isPositiveAndBelow (indexToRemove, numUsed))
{
jassert (data.elements != nullptr);
ElementType removed (data.elements[indexToRemove]);
removeInternal (indexToRemove);
return removed;

View file

@ -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);
}
}