[Uml-devel] KDE/kdesdk

Albert Astals Cid tsdgeos at terra.es
Fri Feb 8 22:20:34 UTC 2008


SVN commit 772500 by aacid:

microoptimization
const & in foreach


 M  +1 -1      cervisia/cvsservice/sshagent.cpp  
 M  +1 -1      cervisia/watchersmodel.cpp  
 M  +1 -1      kompare/libdiff2/komparemodellist.cpp  
 M  +1 -1      umbrello/umbrello/dialogs/umlforeignkeyconstraintdialog.cpp  
 M  +1 -1      umbrello/umbrello/uml.cpp  


--- trunk/KDE/kdesdk/cervisia/cvsservice/sshagent.cpp #772499:772500
@@ -135,7 +135,7 @@
     QRegExp bashPidRx("SSH_AGENT_PID=(\\d*).*");
     QRegExp bashSockRx("SSH_AUTH_SOCK=(.*\\.\\d*);.*");
 
-    foreach( const QString line, m_outputLines )
+    foreach( const QString &line, m_outputLines )
     {
         if( m_pid.isEmpty() )
         {
--- trunk/KDE/kdesdk/cervisia/watchersmodel.cpp #772499:772500
@@ -114,7 +114,7 @@
 
 void WatchersModel::parseData(const QStringList& data)
 {
-    foreach( QString line, data )
+    foreach( const QString &line, data )
     {
         // parse the output line
         QStringList list = splitLine(line);
--- trunk/KDE/kdesdk/kompare/libdiff2/komparemodellist.cpp #772499:772500
@@ -974,7 +974,7 @@
 
 	QStringList list = split( fileContents );
 	QLinkedList<QString> lines;
-	foreach (QString str, list) {
+	foreach (const QString &str, list) {
 		lines.append(str);
 	}
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umlforeignkeyconstraintdialog.cpp #772499:772500
@@ -248,7 +248,7 @@
     actions<<i18n( "No Action" )<<i18n( "Restrict" )<<i18n( "Cascade" )<<i18n( "Set Null" )
            <<i18n( "Set Default" );
 
-    foreach( QString act, actions ) {
+    foreach( const QString &act, actions ) {
         m_GeneralWidgets.updateActionCB->addItem( act );
         m_GeneralWidgets.deleteActionCB->addItem( act );
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #772499:772500
@@ -1281,7 +1281,7 @@
 bool UMLApp::canDecode(const QMimeData* mimeData)
 {
     QStringList supportedFormats = mimeData->formats();
-    foreach( QString format, supportedFormats ) {
+    foreach( const QString &format, supportedFormats ) {
         const char* f = format.toAscii().constData();
         if ( !qstrnicmp(f,"application/x-uml-clip", 22) ) {
             //FIXME need to test for clip1, clip2, clip3, clip4 or clip5




More information about the umbrello-devel mailing list