Skip to content

Commit

Permalink
fix: import hasName from backports
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Aug 28, 2024
1 parent 62cb597 commit 9d885ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ named_union = function(x, y) set_names(union(x, y), union(names(x), names(y)))

register_item = function(env, type) {
function(name, constructor) {
if (utils::hasName(env, name)) stopf("%s %s registered twice", type, name)
if (hasName(env, name)) stopf("%s %s registered twice", type, name)
env[[name]] = constructor
}
}
Expand Down Expand Up @@ -62,6 +62,7 @@ register_mlr3 = function() {

.onLoad = function(libname, pkgname) {
backports::import(pkgname)
backports::import(pkgname, "hasName", force = TRUE)

assign("lg", lgr::get_logger("mlr3"), envir = parent.env(environment()))
if (Sys.getenv("IN_PKGDOWN") == "true") {
Expand Down

0 comments on commit 9d885ee

Please sign in to comment.