Skip to content

Commit

Permalink
fixup for check_indices in subsetter
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Jun 18, 2024
1 parent 3f4d5df commit c1ca0bb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions inst/include/Rcpp/vector/Subsetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class SubsetProxy {

private:

#ifndef RCPP_NO_BOUNDS_CHECK
template <typename IDX>
void check_indices(IDX* x, R_xlen_t n, R_xlen_t size) {
#ifndef RCPP_NO_BOUNDS_CHECK
for (IDX i=0; i < n; ++i) {
if (x[i] < 0 or x[i] >= size) {
if(std::numeric_limits<IDX>::is_integer && size > std::numeric_limits<IDX>::max()) {
Expand All @@ -144,11 +144,8 @@ class SubsetProxy {
stop("index error");
}
}
#endif
}
#else
template <typename IDX>
void check_indices(IDX* x, IDX n, IDX size) {}
#endif

void get_indices( traits::identity< traits::int2type<INTSXP> > t ) {
indices.reserve(rhs_n);
Expand Down

0 comments on commit c1ca0bb

Please sign in to comment.