QList: add missing reserve() call in the initializer_list ctor
Change-Id: Idc46a347009556d06db4bc1f7ce3e2613fb1a405 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
3ce554bef0
commit
86789a48f7
|
|
@ -130,7 +130,7 @@ public:
|
|||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||
inline QList(std::initializer_list<T> args)
|
||||
: d(const_cast<QListData::Data *>(&QListData::shared_null))
|
||||
{ std::copy(args.begin(), args.end(), std::back_inserter(*this)); }
|
||||
{ reserve(args.size()); std::copy(args.begin(), args.end(), std::back_inserter(*this)); }
|
||||
#endif
|
||||
bool operator==(const QList<T> &l) const;
|
||||
inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue