mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
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:
parent
771a5cd65e
commit
6a1c3618ec
@ -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());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
copyright : (C) 2002, 2003 by Scott Wheeler
|
||||
copyright : (C) 2002 - 2004 by Scott Wheeler
|
||||
email : wheeler@kde.org
|
||||
***************************************************************************/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user