From 586de64293e3f6bdb07fd790b66ea59e1b8a3d32 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 19 Jan 2014 10:36:50 +0100 Subject: [PATCH] Restore compatibility with old Qt versions. --- src/core/qcommandlineoption.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/qcommandlineoption.cpp b/src/core/qcommandlineoption.cpp index 5f2f70fbf..c908807b6 100644 --- a/src/core/qcommandlineoption.cpp +++ b/src/core/qcommandlineoption.cpp @@ -183,7 +183,6 @@ QStringList QCommandLineOption::names() const void QCommandLineOptionPrivate::setNames(const QStringList &nameList) { QStringList newNames; - newNames.reserve(nameList.size()); if (nameList.isEmpty()) qWarning("QCommandLineOption: Options must have at least one name"); Q_FOREACH (const QString &name, nameList) { @@ -202,7 +201,7 @@ void QCommandLineOptionPrivate::setNames(const QStringList &nameList) } } // commit - names.swap(newNames); + names = newNames; } /*! @@ -276,11 +275,10 @@ void QCommandLineOption::setDefaultValue(const QString &defaultValue) { QStringList newDefaultValues; if (!defaultValue.isEmpty()) { - newDefaultValues.reserve(1); newDefaultValues << defaultValue; } // commit: - d->defaultValues.swap(newDefaultValues); + d->defaultValues = newDefaultValues; } /*!