| 47 | } |
| 48 | |
| 49 | void set(SEXP x) { |
| 50 | Shield<SEXP> safe_x(x); |
| 51 | |
| 52 | /* check if we can use a fast version */ |
| 53 | if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ // #nocov start |
| 54 | Rf_namesgets(parent, x); |
| 55 | } else { |
| 56 | /* use the slower and more flexible version (callback to R) */ |
| 57 | SEXP namesSym = Rf_install( "names<-" ); |
| 58 | Shield<SEXP> call(Rf_lang3(namesSym, parent, x)); |
| 59 | Shield<SEXP> new_vec(Rcpp_fast_eval(call, R_GlobalEnv)); |
| 60 | parent.set__(new_vec); // #nocov end |
| 61 | } |
| 62 | |
| 63 | } |
| 64 | |
| 65 | } ; |
| 66 |
nothing calls this directly
no test coverage detected