Skip to content

Commit 5bbfb02

Browse files
committed
Further refinement following rebase
1 parent bb52f85 commit 5bbfb02

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

inst/include/Rcpp/Function.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,13 @@ namespace Rcpp{
7070
}
7171

7272
Function_Impl(const std::string& name, const std::string& ns) {
73-
#if R_VERSION < R_Version(4,6,0)
74-
Shield<SEXP> env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str())));
75-
if (env == R_UnboundValue)
76-
Shield<SEXP> env(R_getRegisteredNamespace(ns.c_str()));
77-
if (env == R_NilValue)
78-
stop("there is no namespace called \"%s\"", ns);
79-
#else
73+
#if R_VERSION < R_Version(4,6,0) || R_SVN_REVISION < 89746
8074
Shield<SEXP> env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_NilValue));
75+
#else
76+
Shield<SEXP> env(R_getRegisteredNamespace(ns.c_str()));
77+
#endif
8178
if (env == R_NilValue)
8279
stop("there is no namespace called \"%s\"", ns);
83-
#endif
8480
get_function(name, env);
8581
}
8682

0 commit comments

Comments
 (0)