Browse Source

Minor clean-ups.

tags/2021-05-28
jules 12 years ago
parent
commit
899b1253da
2 changed files with 9 additions and 4 deletions
  1. +1
    -0
      modules/juce_core/containers/juce_Array.h
  2. +8
    -4
      modules/juce_core/containers/juce_ReferenceCountedArray.h

+ 1
- 0
modules/juce_core/containers/juce_Array.h View File

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


+ 8
- 4
modules/juce_core/containers/juce_ReferenceCountedArray.h 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);
}
}


Loading…
Cancel
Save