diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-17 18:28:47 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-17 18:36:58 +0100 |
commit | 03ac778172b783d26bb1c7c5d92bdedd045fcc92 (patch) | |
tree | eecb87130ae0f616fdd5bd5e80144af212a580c0 /src/corelib/tools/qlist.h | |
parent | a8b92f26bcd9fa5c1e77c8e8e5d6ce6f16a68bae (diff) |
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/corelib/tools/qlist.h')
-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 1edac03100..84c742429a 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() { |