From 7ab846473eaf2145b7dbfa09a1519c77d291aca2 Mon Sep 17 00:00:00 2001 From: Mark Lilback Date: Wed, 15 Nov 2017 13:32:35 -0500 Subject: [PATCH] moved dimnames access to use cpp methods instead of c macros --- src/EnvironmentWatcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EnvironmentWatcher.cpp b/src/EnvironmentWatcher.cpp index 2daae2f..d58e238 100644 --- a/src/EnvironmentWatcher.cpp +++ b/src/EnvironmentWatcher.cpp @@ -484,10 +484,10 @@ RC2::EnvironmentWatcher::setDimNames ( RObject& robj, json& jobj ) jobj["dims"] = rvectorToJsonArray(robj); } if (robj.hasAttribute("dimnames")) { - RObject mlist(robj.attr("dimnames")); + Rcpp::List mlist(robj.attr("dimnames")); json dnames; - for (int i=0; i < LENGTH(mlist); i++) { - RObject cl(VECTOR_ELT(mlist, i)); + for (int i=0; i < mlist.length(); i++) { + RObject cl(mlist[i]); dnames.push_back(rvectorToJsonArray(cl)); } jobj["dimnames"] = dnames;