Sadly reserve() just changes the capacity, not the actual size of the vector

so this didn't update the internal size of the std::vector...


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@302668 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2004-04-10 18:39:17 +00:00
parent 771a5cd65e
commit 6a1c3618ec
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/***************************************************************************
copyright : (C) 2002, 2003 by Scott Wheeler
copyright : (C) 2002 - 2004 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
@ -424,7 +424,7 @@ ByteVector &ByteVector::resize(uint size, char padding)
{
if(d->size < size) {
d->data.reserve(size);
::memset(DATA(d), padding, size - d->size);
d->data.insert(d->data.end(), size - d->size, padding);
}
else
d->data.erase(d->data.begin() + size, d->data.end());

View File

@ -1,5 +1,5 @@
/***************************************************************************
copyright : (C) 2002, 2003 by Scott Wheeler
copyright : (C) 2002 - 2004 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/