Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup for check_indices in subsetter
  • Loading branch information
kevinushey committed Jun 18, 2024
commit c1ca0bbba55681e8db07433f48669002f688dc31
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