From 54edb835e127d4cd2636a216fddc4bf0199aa7e0 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Thu, 17 Sep 2026 15:57:13 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20ncol()=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=20=EC=8B=9C=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20as.data.f?= =?UTF-8?q?rame=20=EB=B3=80=ED=99=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/aFIPC.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/aFIPC.R b/R/aFIPC.R index 62546519..cf481488 100644 --- a/R/aFIPC.R +++ b/R/aFIPC.R @@ -86,8 +86,9 @@ autoFIPC <- if (!is.character(itemtype)) stop('Security Error: itemtype must be a character vector') nItems <- NA_integer_ - if (is.data.frame(newformXData) || is.matrix(newformXData)) nItems <- ncol(as.data.frame(newformXData)) - else if (is.data.frame(oldformYData) || is.matrix(oldformYData)) nItems <- ncol(as.data.frame(oldformYData)) + # ⚡ Bolt: Remove as.data.frame() for simple ncol() check to prevent O(N) memory copy overhead + if (is.data.frame(newformXData) || is.matrix(newformXData)) nItems <- ncol(newformXData) + else if (is.data.frame(oldformYData) || is.matrix(oldformYData)) nItems <- ncol(oldformYData) if (!is.na(nItems) && !(length(itemtype) == 1 || length(itemtype) == nItems)) stop(sprintf('Security Error: itemtype must be length 1 or length %d (number of items).', nItems)) # boolean parameter validation