From 7edd52847e7a146c91fa4a0e0c8cfcde2fb1a3b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?I=C3=B1aki=20=C3=9Acar?= <iucar@fedoraproject.org>
Date: Sun, 19 Jan 2025 17:55:17 +0100
Subject: [PATCH] small refinement

---
 R/misc.R | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/R/misc.R b/R/misc.R
index 2c4d161..678b58e 100644
--- a/R/misc.R
+++ b/R/misc.R
@@ -169,8 +169,6 @@ cbind.units <- function(..., deparse.level = 1) {
 }
 
 .deparse <- function(dots, symarg, deparse.level) {
-  if (!is.null(names(dots))) return(dots)
-
   deparse.level <- as.integer(deparse.level)
   if (identical(deparse.level, -1L)) deparse.level <- 0L # R Core's hack
   stopifnot(0 <= deparse.level, deparse.level <= 2)
@@ -184,7 +182,9 @@ cbind.units <- function(..., deparse.level = 1) {
   Nms <- function(i) { if(!is.null(s <- names(symarg)[i]) && nzchar(s)) s else nm(i) }
 
   symarg <- as.list(symarg)[-1L]
-  names(dots) <- sapply(seq_along(dots), Nms)
+  dnames <- sapply(seq_along(dots), Nms)
+  if (!all(sapply(dnames, is.null)))
+    names(dots) <- dnames
   dots
 }