Skip to content

Commit

Permalink
base and internal copies not the same
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Nov 21, 2024
1 parent 16896a0 commit f6a5b61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BugReports: https://github.com/r-lib/lintr/issues
Depends:
R (>= 4.0)
Imports:
backports (>= 1.5.0),
backports (>= 1.1.7),
cli (>= 3.4.0),
codetools,
digest,
Expand Down
9 changes: 9 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
`%||%` <- function(x, y) {
is_atomic_and_missing <- is.atomic(x[[1L]]) && is.na(x[[1L]])
if (is.null(x) || length(x) == 0L || is_atomic_and_missing) {
y
} else {
x
}
}

`%==%` <- function(x, y) {
identical(x, y)
}
Expand Down
2 changes: 0 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ settings <- new.env(parent = emptyenv())

# R>=4.1.0: ...names
backports::import(pkgname, "...names")
# R>=4.4.0: %||%
backports::import(pkgname, "%||%")

utils::assignInMyNamespace("default_settings", list(
linters = default_linters,
Expand Down

0 comments on commit f6a5b61

Please sign in to comment.