Skip to content

Commit c3a450d

Browse files
intersect(colnamesInt(x, NULL), ans) --> sort(ans)
1 parent 41d8fbd commit c3a450d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/mergelist.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ onkeys = function(x, y) {
2323
}
2424
NULL # nocov. Internal error is being called later in mergepair
2525
}
26+
2627
someCols = function(x, cols, drop=character(), keep=character(), retain.order=FALSE) {
2728
keep = colnamesInt(x, keep)
2829
drop = colnamesInt(x, drop)
2930
cols = colnamesInt(x, cols)
3031
ans = union(keep, setdiff(cols, drop))
3132
if (!retain.order) return(ans)
32-
intersect(colnamesInt(x, NULL), ans)
33+
sort(ans)
3334
}
35+
3436
hasindex = function(x, by, retGrp=FALSE) {
3537
index = attr(x, "index", TRUE)
3638
if (is.null(index)) return(FALSE)

0 commit comments

Comments
 (0)