Skip to content

Commit

Permalink
Merge pull request #3464 from infotroph/settings-allequal
Browse files Browse the repository at this point in the history
Avoid bottleneck from duplicating settings during sublist extraction
  • Loading branch information
mdietze authored Mar 2, 2025
2 parents edc14b8 + 995f68e commit e43e8ff
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions base/settings/R/MultiSettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@ is.MultiSettings <- function(x) {
} # "[[.MultiSettings"

.allListElementsEqual <- function(x) {
firstElement <- x[[1]]
replicatedFirstElement <- replicate(
length(x),
firstElement,
simplify = FALSE)
return(isTRUE(
all.equal(replicatedFirstElement, x, check.attributes = FALSE)))
all(sapply(x, identical, x[[1]]))
} # .allListElementsEqual

#' @export
Expand Down

0 comments on commit e43e8ff

Please sign in to comment.