mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 19:25:53 +02:00
- SF#3540497 HashMap iterator crash in VS 2010
- allow Buffer resize to zero
This commit is contained in:
@@ -126,10 +126,12 @@ public:
|
||||
}
|
||||
|
||||
void resize(std::size_t newCapacity, bool preserveContent = true)
|
||||
/// Resizes the buffer. If preserveContent is true,
|
||||
/// Resizes the buffer capacity and size. If preserveContent is true,
|
||||
/// the content of the old buffer is copied over to the
|
||||
/// new buffer. The new capacity can be larger or smaller than
|
||||
/// the current one, but it must not be 0.
|
||||
/// the current one; if it is smaller, capacity will remain intact.
|
||||
/// Size will always be set to the new capacity.
|
||||
///
|
||||
/// Buffers only wrapping externally owned storage can not be
|
||||
/// resized. If resize is attempted on those, IllegalAccessException
|
||||
/// is thrown.
|
||||
@@ -137,8 +139,6 @@ public:
|
||||
if (!_ownMem)
|
||||
throw Poco::InvalidAccessException("Cannot resize buffer which does not own its storage.");
|
||||
|
||||
poco_assert(newCapacity);
|
||||
|
||||
if (newCapacity > _capacity)
|
||||
{
|
||||
T* ptr = new T[newCapacity];
|
||||
|
Reference in New Issue
Block a user