Skip to content

Commit 4d5fcf7

Browse files
last iteration
1 parent ddf052a commit 4d5fcf7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

R/sortuse64.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ orderfin <- function(table, order, x, ...) UseMethod("orderfin")
143143
#' @rdname sortnut
144144
#' @export
145145
orderfin.integer64 <- function(table, order, x, method=NULL, ...) {
146+
if (length(order) > 0 && !is.sorted(table[order])) {
147+
return(rep(FALSE, length(x)))
148+
}
146149
n <- length(x)
147150
if (is.null(method)) {
148151
if (n<4096L) {
@@ -186,6 +189,9 @@ orderpos <- function(table, order, x, ...) UseMethod("orderpos")
186189
#' @param nomatch the value to be returned if an element is not found in the hashmap
187190
#' @export
188191
orderpos.integer64 <- function(table, order, x, nomatch=NA, method=NULL, ...) {
192+
if (length(order) > 0 && !is.sorted(table[order])) {
193+
return(rep(NA_integer_, length(x)))
194+
}
189195
n <- length(x)
190196
if (is.null(method)) {
191197
if (n<4096L) {

0 commit comments

Comments
 (0)