R/rev.R

Defines functions hutilscpp_rev

hutilscpp_rev <- function(x) {
  if (!length(x)) {
    return(x)
  }
  # to avoid slowness on certain altrep vectors
  if (is_altrep(x)) {
    return(seq.int(x[length(x)], x[1]))
  }
  x[length(x):1L]
}
HughParsonage/hutilscpp documentation built on March 1, 2025, 12:29 p.m.