From 9cac87438f40bddc761f437d852a7a0b93283061 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Sun, 29 Sep 2024 12:16:07 -0500 Subject: [PATCH] Remove superfluous cast as size() returns R_xlen_t now (closes #1334) --- ChangeLog | 5 +++++ inst/include/Rcpp/vector/Vector.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ae7d1b59..10e4f52ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-09-29 Dirk Eddelbuettel + + * inst/include/Rcpp/vector/Vector.h: Remove a cast as R_xlen_t + is returned now + 2024-09-17 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll micro version diff --git a/inst/include/Rcpp/vector/Vector.h b/inst/include/Rcpp/vector/Vector.h index 2ce4c18b2..7ef52c0c5 100644 --- a/inst/include/Rcpp/vector/Vector.h +++ b/inst/include/Rcpp/vector/Vector.h @@ -1,6 +1,6 @@ // Vector.h: Rcpp R/C++ interface class library -- vectors // -// Copyright (C) 2010 - 2023 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -331,7 +331,7 @@ class Vector : } inline iterator begin() { return cache.get() ; } - inline iterator end() { return cache.get() + static_cast(size()) ; } + inline iterator end() { return cache.get() + size(); } inline const_iterator begin() const{ return cache.get_const() ; } inline const_iterator end() const{ return cache.get_const() + size() ; } inline const_iterator cbegin() const{ return cache.get_const() ; }