[Rcpp-commits] r2206 - pkg/Rcpp/inst/include/Rcpp/vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 27 12:02:04 CEST 2010


Author: romain
Date: 2010-09-27 12:02:04 +0200 (Mon, 27 Sep 2010)
New Revision: 2206

Modified:
   pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
Log:
identified possible perf improvement

Modified: pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-09-27 09:59:33 UTC (rev 2205)
+++ pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-09-27 10:02:04 UTC (rev 2206)
@@ -65,6 +65,8 @@
 	
 	template <typename T>
 	Vector& operator=( const T& x){
+	    // TODO: wrap will reallocate the memory. we can definitely avoid that
+	    //       if this is of the same size as the target
 		RObject::setSEXP( r_cast<RTYPE>( wrap(x) ) ) ;
 		return *this ;
 	}



More information about the Rcpp-commits mailing list