[rkward-cvs] SF.net SVN: rkward:[4445] trunk/rkward/rkward/misc/rkcommonfunctions.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Nov 23 17:02:02 UTC 2012


Revision: 4445
          http://rkward.svn.sourceforge.net/rkward/?rev=4445&view=rev
Author:   tfry
Date:     2012-11-23 17:02:02 +0000 (Fri, 23 Nov 2012)
Log Message:
-----------
Minor optimization

Modified Paths:
--------------
    trunk/rkward/rkward/misc/rkcommonfunctions.cpp

Modified: trunk/rkward/rkward/misc/rkcommonfunctions.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkcommonfunctions.cpp	2012-11-23 12:01:15 UTC (rev 4444)
+++ trunk/rkward/rkward/misc/rkcommonfunctions.cpp	2012-11-23 17:02:02 UTC (rev 4445)
@@ -182,6 +182,7 @@
 
 	QString unescape (const QString &in) {
 		QString out;
+		out.reserve (in.size ());
 
 		for (int i = 0; i < in.size (); ++i) {
 			QChar c = in[i];
@@ -190,8 +191,8 @@
 				if (i >= in.size ()) break;
 				c = in[i];
 				if (c == 'n') c = '\n';
-				if (c == 't') c = '\t';
-				else if (c == '"') c = '"';
+				else if (c == 't') c = '\t';
+				// NOTE: Quote (") and backslash (\) are escaped by the same symbol, i.e. c = in[i] is good enough
 			}
 			out.append (c);
 		}

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list