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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 15 03:59:05 CET 2012


Author: jjallaire
Date: 2012-11-15 03:59:05 +0100 (Thu, 15 Nov 2012)
New Revision: 3970

Modified:
   pkg/Rcpp/src/Attributes.cpp
Log:
create list in single statement

Modified: pkg/Rcpp/src/Attributes.cpp
===================================================================
--- pkg/Rcpp/src/Attributes.cpp	2012-11-14 20:37:35 UTC (rev 3969)
+++ pkg/Rcpp/src/Attributes.cpp	2012-11-15 02:59:05 UTC (rev 3970)
@@ -1076,18 +1076,17 @@
     }
     
     // return context as a list
-    Rcpp::List context;
-    
-    context["moduleName"] = dynlib.moduleName();
-    context["cppSourcePath"] = dynlib.cppSourcePath();
-    context["buildRequired"] = buildRequired;
-    context["buildDirectory"] = dynlib.buildDirectory();
-    context["generatedCpp"] = dynlib.generatedCpp();
-    context["exportedFunctions"] = dynlib.exportedFunctions();
-    context["cppSourceFilename"] = dynlib.cppSourceFilename();
-    context["dynlibFilename"] = dynlib.dynlibFilename();
-    context["dynlibPath"] = dynlib.dynlibPath();
-    context["depends"] = dynlib.depends();
-    return Rcpp::wrap(context);
+    using namespace Rcpp;
+    return List::create(
+        _["moduleName"] = dynlib.moduleName(),
+        _["cppSourcePath"] = dynlib.cppSourcePath(),
+        _["buildRequired"] = buildRequired,
+        _["buildDirectory"] = dynlib.buildDirectory(),
+        _["generatedCpp"] = dynlib.generatedCpp(),
+        _["exportedFunctions"] = dynlib.exportedFunctions(),
+        _["cppSourceFilename"] = dynlib.cppSourceFilename(),
+        _["dynlibFilename"] = dynlib.dynlibFilename(),
+        _["dynlibPath"] = dynlib.dynlibPath(),
+        _["depends"] = dynlib.depends());
 END_RCPP
 }



More information about the Rcpp-commits mailing list