Skip to content

Commit

Permalink
fix local variable will be copied despite being returned by name (#8157)
Browse files Browse the repository at this point in the history
this is an error with clang 7
note: call 'std::move' explicitly to avoid copying
  • Loading branch information
3nids committed Oct 10, 2018
1 parent b80c95c commit 94a7d9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion external/o2/src/o2replyserver.cpp
Expand Up @@ -105,7 +105,7 @@ QMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data) {
QString value = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.second.trimmed().toLatin1()));
queryParams.insert(key, value);
}
return queryParams;
return std::move( queryParams );
}

void O2ReplyServer::closeServer(QTcpSocket *socket, bool hasparameters)
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/grass/qtermwidget/ColorScheme.cpp
Expand Up @@ -33,6 +33,7 @@
#include <QtDebug>
#include <QSettings>
#include <QDir>
#include <QStringList>


// KDE
Expand Down Expand Up @@ -698,7 +699,7 @@ QList<QString> ColorSchemeManager::listKDE3ColorSchemes()
QStringList ret;
foreach ( QString i, list )
ret << dname + "/" + i;
return ret;
return std::move( ret );
//return KGlobal::dirs()->findAllResources("data",
// "konsole/*.schema",
// KStandardDirs::NoDuplicates);
Expand All @@ -715,7 +716,7 @@ QList<QString> ColorSchemeManager::listColorSchemes()
QStringList ret;
foreach ( QString i, list )
ret << dname + "/" + i;
return ret;
return std::move( ret );
// return KGlobal::dirs()->findAllResources("data",
// "konsole/*.colorscheme",
// KStandardDirs::NoDuplicates);
Expand Down

0 comments on commit 94a7d9d

Please sign in to comment.