[Rcpp-commits] r561 - pkg/src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 2 11:30:11 CET 2010


Author: romain
Date: 2010-02-02 11:30:11 +0100 (Tue, 02 Feb 2010)
New Revision: 561

Modified:
   pkg/src/Rcpp/SimpleVector.h
Log:
added a FIXME

Modified: pkg/src/Rcpp/SimpleVector.h
===================================================================
--- pkg/src/Rcpp/SimpleVector.h	2010-02-02 09:53:48 UTC (rev 560)
+++ pkg/src/Rcpp/SimpleVector.h	2010-02-02 10:30:11 UTC (rev 561)
@@ -85,6 +85,9 @@
 	
 	template <typename InputIterator>
 	void assign( InputIterator first, InputIterator last){
+		/* FIXME: we can do better than this r_cast to avoid 
+		          allocating an unnecessary temporary object
+		 */
 		SEXP x = PROTECT( r_cast<RTYPE>( wrap( first, last ) ) );
 		setSEXP( x) ;
 		UNPROTECT(1) ;
@@ -93,7 +96,9 @@
 private:
 	CTYPE* start ;
 	
-	virtual void update(){ start = get_pointer<RTYPE,CTYPE>(m_sexp) ; }
+	virtual void update(){ 
+		start = get_pointer<RTYPE,CTYPE>(m_sexp) ;
+	}
 	
 	void init(){
 		internal::r_init_vector<RTYPE>(m_sexp) ;



More information about the Rcpp-commits mailing list