Skip to content

Commit f617e37

Browse files
author
thirdwing
committed
Rf_xlength in DottedPairImpl.h
1 parent af61f01 commit f617e37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inst/include/Rcpp/api/meat/DottedPairImpl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace Rcpp{
5353
} else {
5454
if( ref.isNULL( ) ) throw index_out_of_bounds() ;
5555

56-
if( static_cast<R_xlen_t>(index) > ::Rf_length(ref.get__()) ) throw index_out_of_bounds() ;
56+
if( static_cast<R_xlen_t>(index) > ::Rf_xlength(ref.get__()) ) throw index_out_of_bounds() ;
5757

5858
size_t i=1;
5959
SEXP x = ref.get__() ;
@@ -70,7 +70,7 @@ namespace Rcpp{
7070
template <typename T>
7171
void DottedPairImpl<CLASS>::replace( const int& index, const T& object ) {
7272
CLASS& ref = static_cast<CLASS&>(*this) ;
73-
if( static_cast<R_xlen_t>(index) >= ::Rf_length(ref.get__()) ) throw index_out_of_bounds() ;
73+
if( static_cast<R_xlen_t>(index) >= ::Rf_xlength(ref.get__()) ) throw index_out_of_bounds() ;
7474

7575
Shield<SEXP> x( pairlist( object ) );
7676
SEXP y = ref.get__() ;
@@ -84,7 +84,7 @@ namespace Rcpp{
8484
template <typename CLASS>
8585
void DottedPairImpl<CLASS>::remove( const size_t& index ) {
8686
CLASS& ref = static_cast<CLASS&>(*this) ;
87-
if( static_cast<R_xlen_t>(index) >= Rf_length(ref.get__()) ) throw index_out_of_bounds() ;
87+
if( static_cast<R_xlen_t>(index) >= Rf_xlength(ref.get__()) ) throw index_out_of_bounds() ;
8888
if( index == 0 ){
8989
ref.set__( CDR( ref.get__() ) ) ;
9090
} else{

0 commit comments

Comments
 (0)