File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,6 @@ inline bool r_vector<SEXP>::const_iterator::use_buf(bool is_altrep) {
56
56
return false ;
57
57
}
58
58
59
- template <>
60
- inline SEXP r_vector<SEXP>::const_iterator::operator *() const {
61
- return VECTOR_ELT (data_->data (), pos_);
62
- }
63
-
64
59
typedef r_vector<SEXP> list;
65
60
66
61
namespace writable {
Original file line number Diff line number Diff line change @@ -697,10 +697,12 @@ inline typename r_vector<T>::const_iterator r_vector<T>::find(
697
697
698
698
template <typename T>
699
699
inline T r_vector<T>::const_iterator::operator *() const {
700
- if (data_->is_altrep ()) {
700
+ if (use_buf (data_->is_altrep ())) {
701
+ // Use pre-loaded buffer for compatible ALTREP types
701
702
return static_cast <T>(buf_[pos_ - block_start_]);
702
703
} else {
703
- return static_cast <T>(data_->data_p_ [pos_]);
704
+ // Otherwise pass through to normal retrieval method
705
+ return data_->operator [](pos_);
704
706
}
705
707
}
706
708
Original file line number Diff line number Diff line change @@ -45,11 +45,6 @@ inline bool r_vector<r_string>::const_iterator::use_buf(bool is_altrep) {
45
45
return false ;
46
46
}
47
47
48
- template <>
49
- inline r_string r_vector<r_string>::const_iterator::operator *() const {
50
- return STRING_ELT (data_->data (), pos_);
51
- }
52
-
53
48
typedef r_vector<r_string> strings;
54
49
55
50
namespace writable {
You can’t perform that action at this time.
0 commit comments