Skip to content

Commit 81b3657

Browse files
committed
exchange subset with .shallow
1 parent 8deaa6a commit 81b3657

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/bmerge.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
116116
# we've always coerced to int and returned int, for convenience.
117117
if (length(ic_idx)>1L) {
118118
xc_idx = xcols[ic_idx]
119-
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], mergeType) == "double")]) {
119+
for (xb in xc_idx[which(vapply_1c(.shallow(x, xc_idx), mergeType) == "double")]) {
120120
if (isReallyReal(x[[xb]])) {
121121
coerce_x = FALSE
122122
break
@@ -129,7 +129,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
129129
set(callersi, j=icol, value=i[[icol]]) # change the shallow copy of i up in [.data.table to reflect in the result, too.
130130
if (length(ic_idx)>1L) {
131131
xc_idx = xcols[ic_idx]
132-
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], mergeType) == "double")]) {
132+
for (xb in xc_idx[which(vapply_1c(.shallow(x, xc_idx), mergeType) == "double")]) {
133133
coerce_col(x, xb, "double", "integer", paste0("x.", names(x)[xb]), xname, msg)
134134
}
135135
}
@@ -144,7 +144,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
144144
coerce_col(i, icol, "integer", "double", iname, xname, msg)
145145
if (length(ic_idx)>1L) {
146146
xc_idx = xcols[ic_idx]
147-
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], mergeType) == "integer")]) {
147+
for (xb in xc_idx[which(vapply_1c(.shallow(x, xc_idx), mergeType) == "integer")]) {
148148
coerce_col(x, xb, "integer", "double", paste0("x.", names(x)[xb]), xname, msg)
149149
}
150150
}

0 commit comments

Comments
 (0)