Skip to content

Commit 7ab8464

Browse files
committed
moved dimnames access to use cpp methods instead of c macros
1 parent 09e257d commit 7ab8464

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/EnvironmentWatcher.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ RC2::EnvironmentWatcher::setDimNames ( RObject& robj, json& jobj )
484484
jobj["dims"] = rvectorToJsonArray(robj);
485485
}
486486
if (robj.hasAttribute("dimnames")) {
487-
RObject mlist(robj.attr("dimnames"));
487+
Rcpp::List mlist(robj.attr("dimnames"));
488488
json dnames;
489-
for (int i=0; i < LENGTH(mlist); i++) {
490-
RObject cl(VECTOR_ELT(mlist, i));
489+
for (int i=0; i < mlist.length(); i++) {
490+
RObject cl(mlist[i]);
491491
dnames.push_back(rvectorToJsonArray(cl));
492492
}
493493
jobj["dimnames"] = dnames;

0 commit comments

Comments
 (0)