Skip to content

Commit 4e05d8d

Browse files
committed
Removed redundant empty rows check
1 parent e757125 commit 4e05d8d

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

R/data.table.R

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,23 +1368,6 @@ replace_dot_alias = function(e) {
13681368
# updates by reference to existing columns
13691369
cols = as.integer(m)
13701370
newnames=NULL
1371-
if (identical(irows, integer())) {
1372-
# Empty integer() means no rows e.g. logical i with only FALSE and NA
1373-
# got converted to empty integer() by the which() above
1374-
# Short circuit and do-nothing since columns already exist. If some don't
1375-
# exist then for consistency with cases where irows is non-empty, we need to create
1376-
# them of the right type and populate with NA. Which will happen via the regular
1377-
# alternative branches below, to cover #759.
1378-
# We need this short circuit at all just for convenience. Otherwise users may need to
1379-
# fix errors in their RHS when called on empty edge cases, even when the result won't be
1380-
# used anyway (so it would be annoying to have to fix it.)
1381-
if (verbose) {
1382-
catf("No rows match i. No new columns to add so not evaluating RHS of :=\nAssigning to 0 row subset of %d rows\n", nrow(x))
1383-
}
1384-
.Call(Cassign, x, irows, NULL, NULL, NULL) # only purpose is to write 0 to .Last.updated
1385-
.global$print = address(x)
1386-
return(invisible(x))
1387-
}
13881371
}else{
13891372
# Adding new column(s).
13901373
newnames=setdiff(lhs, names_x)

0 commit comments

Comments
 (0)