1
- // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2
1
//
3
2
// Vector.h: Rcpp R/C++ interface class library -- vectors
4
3
//
5
- // Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois
4
+ // Copyright (C) 2010 - 2020 Dirk Eddelbuettel and Romain Francois
6
5
//
7
6
// This file is part of Rcpp.
8
7
//
@@ -301,12 +300,12 @@ class Vector :
301
300
* one dimensional offset doing bounds checking to ensure
302
301
* it is valid
303
302
*/
304
- R_xlen_t offset (const R_xlen_t& i) const {
303
+ R_xlen_t offset (const R_xlen_t& i) const { // #nocov start
305
304
if (i < 0 || i >= ::Rf_xlength (Storage::get__ ()) ) {
306
305
const char * fmt = " Index out of bounds: [index=%i; extent=%i]." ;
307
306
throw index_out_of_bounds (fmt, i, ::Rf_xlength (Storage::get__ ()) ) ;
308
307
}
309
- return i ;
308
+ return i ; // #nocov end
310
309
}
311
310
312
311
R_xlen_t offset (const std::string& name) const {
@@ -352,9 +351,9 @@ class Vector :
352
351
inline Proxy at ( const size_t & i) {
353
352
return cache.ref ( offset (i) ) ;
354
353
}
355
- inline const_Proxy at ( const size_t & i) const {
354
+ inline const_Proxy at ( const size_t & i) const { // #nocov start
356
355
return cache.ref ( offset (i) ) ;
357
- }
356
+ } // #nocov end
358
357
359
358
inline Proxy operator ()( const size_t & i, const size_t & j) {
360
359
return cache.ref ( offset (i,j) ) ;
@@ -632,7 +631,7 @@ class Vector :
632
631
iterator this_end (end ());
633
632
if ( Rf_isNull (names) ){
634
633
for ( ; it < this_end; ++it, ++target_it ){
635
- *target_it = *it ;
634
+ *target_it = *it ; // #nocov start
636
635
}
637
636
} else {
638
637
Shield<SEXP> newnames ( ::Rf_allocVector ( STRSXP, n + 1 ) ) ;
@@ -642,7 +641,7 @@ class Vector :
642
641
SET_STRING_ELT ( newnames, i, STRING_ELT (names, i ) ) ;
643
642
}
644
643
SET_STRING_ELT ( newnames, i, Rf_mkChar (" " ) ) ;
645
- target.attr (" names" ) = newnames ;
644
+ target.attr (" names" ) = newnames ; // #nocov end
646
645
}
647
646
*target_it = object_sexp;
648
647
Storage::set__ ( target.get__ () ) ;
@@ -685,8 +684,8 @@ class Vector :
685
684
int i=0 ;
686
685
if ( Rf_isNull (names) ){
687
686
for ( ; it < this_end; ++it, ++target_it,i++ ){
688
- *target_it = *it ;
689
- SET_STRING_ELT ( newnames, i , R_BlankString );
687
+ *target_it = *it ; // #nocov
688
+ SET_STRING_ELT ( newnames, i , R_BlankString ); // #nocov
690
689
}
691
690
} else {
692
691
for ( ; it < this_end; ++it, ++target_it, i++ ){
0 commit comments