diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-17 17:28:47 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-17 17:36:58 (GMT) |
commit | 03ac778172b783d26bb1c7c5d92bdedd045fcc92 (patch) | |
tree | eecb87130ae0f616fdd5bd5e80144af212a580c0 /src | |
parent | a8b92f26bcd9fa5c1e77c8e8e5d6ce6f16a68bae (diff) | |
download | Qt-03ac778172b783d26bb1c7c5d92bdedd045fcc92.zip Qt-03ac778172b783d26bb1c7c5d92bdedd045fcc92.tar.gz Qt-03ac778172b783d26bb1c7c5d92bdedd045fcc92.tar.bz2 |
unbreak QList::append() and co. again
make sure that the detached object is always at least as big as the
original one. that may be somewhat wasteful, but it is no worse than
before the detach() optimization. one may consider improvements later.
Reviewed-by: joao
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qlist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 1edac03..84c7424 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -122,7 +122,7 @@ public: inline int size() const { return p.size(); } inline void detach() { if (d->ref != 1) detach_helper(); } - inline void detach_grow(int by) { if (d->ref != 1) detach_helper_grow(d->end - d->begin + by); } + inline void detach_grow(int by) { if (d->ref != 1) detach_helper_grow(d->alloc + by); } inline void detachShared() { |