File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed
Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 1+ 2020-05-17 Kevin Ushey <kevinushey@gmail.com>
2+
3+ * inst/include/Rcpp/String.h: don't preserve returned SEXP in wrap
4+ * inst/include/RcppCommon.h: simplify
5+
162020-04-30 Dirk Eddelbuettel <edd@debian.org>
27
38 * DESCRIPTION (Version, Date): Roll minor version
Original file line number Diff line number Diff line change @@ -532,7 +532,6 @@ namespace Rcpp {
532532 RCPP_STRING_DEBUG (" wrap<String>()" );
533533 Shield<SEXP> res (Rf_allocVector (STRSXP, 1 ));
534534 SEXP data = object.get_sexp ();
535- Rcpp_PreserveObject (data);
536535 SET_STRING_ELT (res, 0 , data);
537536 return res;
538537 }
Original file line number Diff line number Diff line change @@ -101,22 +101,13 @@ namespace Rcpp {
101101 }
102102
103103 inline SEXP Rcpp_ReplaceObject (SEXP x, SEXP y) {
104- if (Rf_isNull (x)) {
105- Rcpp_PreserveObject (y);
106- } else if (Rf_isNull (y)) {
107- Rcpp_ReleaseObject (x); // #nocov
108- } else {
109- // if we are setting to the same SEXP as we already have, do nothing
110- if (x != y) {
111-
112- // the previous SEXP was not NULL, so release it
113- Rcpp_ReleaseObject (x);
114-
115- // the new SEXP is not NULL, so preserve it
116- Rcpp_PreserveObject (y);
117104
118- }
105+ // if we are setting to the same SEXP as we already have, do nothing
106+ if (x != y) {
107+ Rcpp_ReleaseObject (x);
108+ Rcpp_PreserveObject (y);
119109 }
110+
120111 return y;
121112 }
122113
You can’t perform that action at this time.
0 commit comments