Skip to content

Commit

Permalink
don't check index when constructing iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Jun 11, 2024
1 parent 394e220 commit c8c3a5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inst/include/Rcpp/vector/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ namespace traits{
void update( const VECTOR& v ){
p = const_cast<VECTOR*>(&v) ;
}
inline iterator get() const { check_index(0); return iterator( proxy(*p, 0 ) ) ;}
inline const_iterator get_const() const { check_index(0); return const_iterator( const_proxy(*p, 0) ) ; }
inline iterator get() const { return iterator( proxy(*p, 0 ) ) ;}
inline const_iterator get_const() const { return const_iterator( const_proxy(*p, 0) ) ; }

inline proxy ref() { check_index(0); return proxy(*p,0) ; }
inline proxy ref(R_xlen_t i) { check_index(i); return proxy(*p,i);}
Expand Down
2 changes: 1 addition & 1 deletion tests/tinytest.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ if (requireNamespace("tinytest", quietly=TRUE)) {
## there are several more granular ways to test files in a tinytest directory,
## see its package vignette; tests can also run once the package is installed
## using the same command `test_package(pkgName)`, or by director or file
tinytest::test_package("Rcpp", ncpu=getOption("Ncpus", 1))
tinytest::test_package("Rcpp", ncpu=getOption("Ncpus"))
}

0 comments on commit c8c3a5c

Please sign in to comment.