From d3fe06db439a6bc0e5372552820cb8183101bbe7 Mon Sep 17 00:00:00 2001 From: Charlie Gao <53399081+shikokuchuo@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:37:22 +0900 Subject: [PATCH] preserve reverse cancellation order Signed-off-by: Charlie Gao <53399081+shikokuchuo@users.noreply.github.com> --- R/mirai.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/mirai.R b/R/mirai.R index 00574f1e..89492970 100644 --- a/R/mirai.R +++ b/R/mirai.R @@ -424,7 +424,13 @@ collect_mirai <- collect_aio #' @export #' stop_mirai <- function(x) { - is.list(x) && return(as.logical(lapply(x, stop_mirai))) + is.list(x) && { + xlen <- length(x) + vec <- logical(xlen) + for (i in seq_len(xlen)) + vec[[i]] <- stop_mirai(x[[xlen - i + 1L]]) + return(vec) + } .compute <- attr(x, "profile") envir <- if (is.character(.compute)) ..[[.compute]] stop_aio(x)