Skip to content

Commit faa5474

Browse files
rename getClass helper: mergeType
1 parent 4dfe8ab commit faa5474

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

R/bmerge.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
2525

2626
supported = c(ORDERING_TYPES, "factor", "integer64")
2727

28-
getClass = function(x) {
28+
mergeType = function(x) {
2929
ans = typeof(x)
3030
if (ans=="integer") { if (is.factor(x)) ans = "factor" }
3131
else if (ans=="double") { if (inherits(x, "integer64")) ans = "integer64" }
@@ -52,8 +52,8 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
5252
# Note that if i is keyed, if this coerces i's key gets dropped by set()
5353
ic = icols[a]
5454
xc = xcols[a]
55-
x_merge_type = getClass(x[[xc]])
56-
i_merge_type = getClass(i[[ic]])
55+
x_merge_type = mergeType(x[[xc]])
56+
i_merge_type = mergeType(i[[ic]])
5757
xname = paste0("x.", names(x)[xc])
5858
iname = paste0("i.", names(i)[ic])
5959
if (!x_merge_type %chin% supported) stopf("%s is type %s which is not supported by data.table join", xname, x_merge_type)
@@ -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], getClass) == "double")]) {
119+
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], 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=ic, value=i[[ic]]) # 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], getClass) == "double")]) {
132+
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], 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, ic, "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], getClass) == "integer")]) {
147+
for (xb in xc_idx[which(vapply_1c(x[0L, xc_idx, with=FALSE], mergeType) == "integer")]) {
148148
coerce_col(x, xb, "integer", "double", paste0("x.", names(x)[xb]), xname, msg)
149149
}
150150
}

0 commit comments

Comments
 (0)