Skip to content

Commit

Permalink
identical is faster
Browse files Browse the repository at this point in the history
  • Loading branch information
philchalmers committed Jul 24, 2024
1 parent deb1c53 commit 32a8223
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

- Better name checking when using the supported `list` inputs in `runSimulation()`
and `runArraySimulation()`


- `SimCollect()` more efficient when combining a large number of files (e.g.,
greater than 5000 `.rds` files stored via `runArraySimulation()`)

## Changes in SimDesign 2.16

Expand Down
2 changes: 1 addition & 1 deletion R/SimCollect.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ SimCollect <- function(files = NULL, filename = NULL,
if(i %in% print_when) cat(".")
left <- setdiff(1L:length(designs), identical_set)
pick_design <- designs[[min(left)]]
matched <- which(sapply(designs, \(x) all(x == pick_design)))
matched <- which(sapply(designs, \(x) identical(x, pick_design)))
set.index[matched] <- rep(set.count, length(matched))
set.count <- set.count + 1L
identical_set <- c(identical_set, matched)
Expand Down

0 comments on commit 32a8223

Please sign in to comment.