Skip to content

Commit a280acb

Browse files
More Rcpp-idiomatic to avoid explicit PROTECT
1 parent 71e9901 commit a280acb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

inst/include/Rcpp/DataFrame.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ namespace Rcpp{
101101
if( ::Rf_inherits( x, "data.frame" )){
102102
Parent::set__( x ) ;
103103
} else{
104-
SEXP y = PROTECT(internal::convert_using_rfunction( x, "as.data.frame" )) ;
104+
Shield<SEXP> y(internal::convert_using_rfunction( x, "as.data.frame" )) ;
105105
Parent::set__( y ) ;
106-
UNPROTECT(1);
107106
}
108107
}
109108

0 commit comments

Comments
 (0)