From 338d4ce5e7e9097488706f431a63476fc579fb5b Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 30 Sep 2025 13:31:12 -0700 Subject: [PATCH] define splitList unconditionally --- pkg/R/doParallel.R | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pkg/R/doParallel.R b/pkg/R/doParallel.R index fb33b5a..383eb93 100644 --- a/pkg/R/doParallel.R +++ b/pkg/R/doParallel.R @@ -141,16 +141,7 @@ comp <- if (getRversion() < "2.13.0") { } } - -parSpl <- try(parallel::splitList, silent=TRUE) -## Use the "splitList" function from parallel if it's exported -## Otherwise, use the definition it had in R 3.0.2. -"splitList" <- if (inherits(parSpl, "try-error")) { - function (x, ncl) - lapply(splitIndices(length(x), ncl), function(i) x[i]) -} else { - parSpl -} +splitList <- function (x, ncl) lapply(splitIndices(length(x), ncl), function(i) x[i]) doParallelMC <- function(obj, expr, envir, data) { # set the default mclapply options @@ -522,3 +513,4 @@ doParallelSNOW <- function(obj, expr, envir, data) { getResult(it) } } +