[Rcpp-commits] r190 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Dec 14 01:02:20 CET 2009
Author: edd
Date: 2009-12-14 01:02:20 +0100 (Mon, 14 Dec 2009)
New Revision: 190
Modified:
pkg/src/RcppStringVector.cpp
pkg/src/RcppStringVectorView.cpp
Log:
minor cleanup and fixes
Modified: pkg/src/RcppStringVector.cpp
===================================================================
--- pkg/src/RcppStringVector.cpp 2009-12-13 19:47:59 UTC (rev 189)
+++ pkg/src/RcppStringVector.cpp 2009-12-14 00:02:20 UTC (rev 190)
@@ -53,7 +53,7 @@
return length;
}
-inline std::vector<std::string> RcppStringVector::stlVector() const {
+std::vector<std::string> RcppStringVector::stlVector() const {
std::vector<std::string> tmp(length);
for (int i = 0; i < length; i++)
tmp[i] = v[i];
Modified: pkg/src/RcppStringVectorView.cpp
===================================================================
--- pkg/src/RcppStringVectorView.cpp 2009-12-13 19:47:59 UTC (rev 189)
+++ pkg/src/RcppStringVectorView.cpp 2009-12-14 00:02:20 UTC (rev 190)
@@ -22,7 +22,6 @@
#include <RcppStringVectorView.h>
RcppStringVectorView::RcppStringVectorView(SEXP vec) {
- //int i;
if (Rf_isMatrix(vec) || Rf_isLogical(vec))
throw std::range_error("RcppStringVectorView: invalid numeric vector in constructor");
if (!Rf_isString(vec))
@@ -30,14 +29,11 @@
int len = Rf_length(vec);
if (len == 0)
throw std::range_error("RcppStringVectorView: null vector in constructor");
- //v = new (char *)[len];
- //for (i = 0; i < len; i++)
- // v[i] = string(CHAR(STRING_ELT(vec,i)));
length = len;
v = vec;
}
-inline const char * RcppStringVectorView::operator()(int i) const {
+const char* RcppStringVectorView::operator()(int i) const {
if (i < 0 || i >= length) {
std::ostringstream oss;
oss << "RcppStringVector: subscript out of range: " << i;
@@ -46,6 +42,6 @@
return CHAR(STRING_ELT(v,i));
}
-inline int RcppStringVectorView::size() const {
+int RcppStringVectorView::size() const {
return length;
}
More information about the Rcpp-commits
mailing list