From 03ac778172b783d26bb1c7c5d92bdedd045fcc92 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Feb 2010 18:28:47 +0100 Subject: 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 --- src/corelib/tools/qlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() { -- cgit v0.12