@@ -25,31 +25,17 @@ namespace Rcpp {
2525inline SEXP Rcpp_eval (SEXP expr, SEXP env) {
2626
2727 // 'identity' function used to capture errors, interrupts
28- SEXP identity = Rf_findFun (
29- ::Rf_install (" identity" ),
30- R_BaseNamespace
31- );
28+ SEXP identity = Rf_findFun (::Rf_install (" identity" ), R_BaseNamespace);
3229
3330 if (identity == R_UnboundValue) {
3431 stop (" Failed to find 'base::identity()'" );
3532 }
3633
37- // define the evalq call -- the actual R evaluation we
38- // want to execute
39- Shield<SEXP> evalqCall (Rf_lang3 (
40- ::Rf_install (" evalq" ),
41- expr,
42- env
43- ));
34+ // define the evalq call -- the actual R evaluation we want to execute
35+ Shield<SEXP> evalqCall (Rf_lang3 (::Rf_install (" evalq" ), expr, env));
4436
45- // define the call -- enclose with `tryCatch` so we can record
46- // and later forward error messages
47- Shield<SEXP> call (Rf_lang4 (
48- ::Rf_install (" tryCatch" ),
49- evalqCall,
50- identity,
51- identity
52- ));
37+ // define the call -- enclose with `tryCatch` so we can record and forward error messages
38+ Shield<SEXP> call (Rf_lang4 (::Rf_install (" tryCatch" ), evalqCall, identity, identity));
5339 SET_TAG (CDDR (call), ::Rf_install (" error" ));
5440 SET_TAG (CDDR (CDR (call)), ::Rf_install (" interrupt" ));
5541
@@ -61,10 +47,7 @@ inline SEXP Rcpp_eval(SEXP expr, SEXP env) {
6147
6248 if (Rf_inherits (res, " error" )) {
6349
64- Shield<SEXP> conditionMessageCall (::Rf_lang2 (
65- ::Rf_install (" conditionMessage" ),
66- res
67- ));
50+ Shield<SEXP> conditionMessageCall (::Rf_lang2 (::Rf_install (" conditionMessage" ), res));
6851
6952 Shield<SEXP> conditionMessage (::Rf_eval (conditionMessageCall, R_GlobalEnv));
7053 throw eval_error (CHAR (STRING_ELT (conditionMessage, 0 )));
0 commit comments