Browse Source

Added StringArray::clearQuick method.

tags/2021-05-28
jules 12 years ago
parent
commit
3330b9b587
4 changed files with 13 additions and 8 deletions
  1. +0
    -1
      modules/juce_core/containers/juce_Array.h
  2. +3
    -5
      modules/juce_core/containers/juce_SortedSet.h
  3. +5
    -0
      modules/juce_core/text/juce_StringArray.cpp
  4. +5
    -2
      modules/juce_core/text/juce_StringArray.h

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

@@ -204,7 +204,6 @@ public:
}
/** Removes all elements from the array without freeing the array's allocated storage.
@see clear
*/
void clearQuick()


+ 3
- 5
modules/juce_core/containers/juce_SortedSet.h View File

@@ -135,8 +135,7 @@ public:
}
//==============================================================================
/** Returns the current number of elements in the set.
*/
/** Returns the current number of elements in the set. */
inline int size() const noexcept
{
return data.size();
@@ -185,7 +184,6 @@ public:
}
/** Returns the first element in the set, or 0 if the set is empty.
@see operator[], getUnchecked, getLast
*/
inline ElementType getFirst() const noexcept
@@ -194,7 +192,6 @@ public:
}
/** Returns the last element in the set, or 0 if the set is empty.
@see operator[], getUnchecked, getFirst
*/
inline ElementType getLast() const noexcept
@@ -448,7 +445,8 @@ public:
If you need to exchange two arrays, this is vastly quicker than using copy-by-value
because it just swaps their internal pointers.
*/
void swapWith (SortedSet& otherSet) noexcept
template <class OtherSetType>
void swapWith (OtherSetType& otherSet) noexcept
{
data.swapWith (otherSet.data);
}


+ 5
- 0
modules/juce_core/text/juce_StringArray.cpp View File

@@ -135,6 +135,11 @@ void StringArray::clear()
strings.clear();
}
void StringArray::clearQuick()
{
strings.clearQuick();
}
const String& StringArray::operator[] (const int index) const noexcept
{
if (isPositiveAndBelow (index, strings.size()))


+ 5
- 2
modules/juce_core/text/juce_StringArray.h View File

@@ -284,14 +284,17 @@ public:
/** Removes all elements from the array. */
void clear();
/** Removes a string from the array.
/** Removes all elements from the array without freeing the array's allocated storage.
@see clear
*/
void clearQuick();
/** Removes a string from the array.
If the index is out-of-range, no action will be taken.
*/
void remove (int index);
/** Finds a string in the array and removes it.
This will remove the first occurrence of the given string from the array. The
comparison may be case-insensitive depending on the ignoreCase parameter.
*/


Loading…
Cancel
Save