From 4edf1fd8fa644356390700b3c8037e4a18d0f099 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 26 Jul 2013 07:30:54 -0700 Subject: [PATCH] Add OwnedArray::clearQuick() --- modules/beast_core/containers/beast_OwnedArray.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/beast_core/containers/beast_OwnedArray.h b/modules/beast_core/containers/beast_OwnedArray.h index 697a6e3dc..f4f964cef 100644 --- a/modules/beast_core/containers/beast_OwnedArray.h +++ b/modules/beast_core/containers/beast_OwnedArray.h @@ -101,6 +101,17 @@ public: numUsed = 0; } + /** Removes all elements from the array without freeing the array's allocated storage. + + @see clear + */ + void clearQuick() + { + const ScopedLockType lock (getLock()); + deleteAllElements(); + numUsed = 0; + } + //============================================================================== /** Returns the number of items currently in the array. @see operator[]