From 1222b0e15b3153dc2a3dabbe34e1f900df6906f5 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 24 Apr 2008 20:41:04 +0000 Subject: [PATCH] avoid unnecessary copies by using const & in foreach svn path=/trunk/KDE/kdebase/apps/konsole/; revision=800783 --- src/Application.cpp | 2 +- src/CopyInputDialog.cpp | 2 +- src/ProcessInfo.cpp | 4 ++-- src/ShellCommand.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 715a3323b..f3f52e896 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -218,7 +218,7 @@ void Application::processProfileChangeArgs(KCmdLineArgs* args,MainWindow* window } // temporary changes to profile options specified on the command line - foreach( QString value , args->getOptionList("p") ) + foreach( const QString &value , args->getOptionList("p") ) { ProfileCommandParser parser; diff --git a/src/CopyInputDialog.cpp b/src/CopyInputDialog.cpp index 252768df7..3ed87068a 100644 --- a/src/CopyInputDialog.cpp +++ b/src/CopyInputDialog.cpp @@ -94,7 +94,7 @@ void CopyInputDialog::setSelectionChecked(bool checked) if (selected.count() > 1) { - foreach(QModelIndex index,selected) + foreach(const QModelIndex &index,selected) setRowChecked(index.row(),checked); } else diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index 3be15c315..a01d3e2a0 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -399,7 +399,7 @@ bool UnixProcessInfo::readArguments(int pid) QStringList argList = data.split( QChar('\0') ); - foreach ( QString entry , argList ) + foreach ( const QString &entry , argList ) { if (!entry.isEmpty()) addArgument(entry); @@ -449,7 +449,7 @@ bool UnixProcessInfo::readEnvironment(int pid) QStringList bindingList = data.split( QChar('\0') ); - foreach( QString entry , bindingList ) + foreach( const QString &entry , bindingList ) { QString name; QString value; diff --git a/src/ShellCommand.cpp b/src/ShellCommand.cpp index a06a351b6..70fce15ce 100644 --- a/src/ShellCommand.cpp +++ b/src/ShellCommand.cpp @@ -93,7 +93,7 @@ QStringList ShellCommand::expand(const QStringList& items) { QStringList result; - foreach( QString item , items ) + foreach( const QString &item , items ) result << expand(item); return result;