Skip to content

Commit

Permalink
tiny performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Feb 16, 2025
1 parent fd98a34 commit 4b71008
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/getOptionOrEnvVar.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ getOption2 <- local({
prefixes <- paste(c(.packageName, "future"), ".", sep = "")

function(name, default = NULL) {
value <- getOption(name, NULL)
value <- getOption(name)
if (!is.null(value)) return(value)

## Backward compatibility with the 'future' package
basename <- sub(re, "", name)
names <- unique(c(name, paste(prefixes, basename, sep="")))

## Is there an R option set?
for (name in names) {
value <- getOption(name, NULL)
value <- getOption(name)
if (!is.null(value)) return(value)
}

Expand Down

0 comments on commit 4b71008

Please sign in to comment.