Skip to content

Commit fae5952

Browse files
committed
move/delete dangling ^^ comments from #5089
1 parent 78095d2 commit fae5952

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

R/data.table.R

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,16 +1737,13 @@ replace_dot_alias = function(e) {
17371737
if (!(is.call(q) && is.symbol(q[[1L]]) && is.symbol(q[[2L]]) && (q1 <- q[[1L]]) %chin% gfuns)) return(FALSE)
17381738
if (!(q2 <- q[[2L]]) %chin% names(SDenv$.SDall) && q2 != ".I") return(FALSE) # 875
17391739
if ((length(q)==2L || (!is.null(names(q)) && startsWith(names(q)[3L], "na")))) return(TRUE)
1740+
# ^^ base::startWith errors on NULL unfortunately
17401741
if (length(q)>=2L && q[[1L]] == "shift") {
17411742
q_named = match.call(shift, q)
17421743
if (!is.call(q_named[["fill"]]) && is.null(q_named[["give.names"]])) return(TRUE)
1743-
} # add gshift support
1744-
# weighted.mean #3977
1745-
if (length(q)>=3L && q[[1L]] == "weighted.mean") return(TRUE)
1746-
# ^^ base::startWith errors on NULL unfortunately
1747-
# head-tail uses default value n=6 which as of now should not go gforce ... ^^
1748-
# otherwise there must be three arguments, and only in two cases:
1749-
# 1) head/tail(x, 1) or 2) x[n], n>0
1744+
}
1745+
if (length(q)>=3L && q[[1L]] == "weighted.mean") return(TRUE) #3977
1746+
# otherwise there must be three arguments
17501747
length(q)==3L && length(q3 <- q[[3L]])==1L && is.numeric(q3) &&
17511748
( (q1 %chin% c("head", "tail")) || ((q1 == "[" || (q1 == "[[" && eval(call('is.atomic', q[[2L]]), envir=x))) && q3>0L) )
17521749
}

0 commit comments

Comments
 (0)