[Rprotobuf-commits] r529 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 10 11:05:04 CEST 2013


Author: murray
Date: 2013-09-10 11:05:03 +0200 (Tue, 10 Sep 2013)
New Revision: 529

Modified:
   pkg/src/rprotobuf.cpp
Log:
Improve string concatenation idiom.



Modified: pkg/src/rprotobuf.cpp
===================================================================
--- pkg/src/rprotobuf.cpp	2013-09-07 06:46:57 UTC (rev 528)
+++ pkg/src/rprotobuf.cpp	2013-09-10 09:05:03 UTC (rev 529)
@@ -236,13 +236,13 @@
 		case CHARSXP:
 			{
 				field_desc = (GPB::FieldDescriptor*)desc->FindFieldByName( CHAR(name) ) ;
-				error_message += string(" '") + CHAR(name) + "'";
+				error_message = error_message + " '" + CHAR(name) + "'";
 				break ;
 			}
 		case STRSXP:
 			{
 				field_desc = (GPB::FieldDescriptor*)desc->FindFieldByName( CHAR( STRING_ELT(name, 0 ) ) ) ;
-				error_message += string(" '") + CHAR( STRING_ELT(name, 0 )) + "'";
+				error_message = error_message + " '" + CHAR( STRING_ELT(name, 0 )) + "'";
 				break ;
 			}
 		case REALSXP:



More information about the Rprotobuf-commits mailing list