Skip to content

Commit f7fd0e0

Browse files
committed
fix strings
1 parent ff8e314 commit f7fd0e0

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

inst/include/cpp11/strings.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,10 @@ typedef r_vector<r_string> strings;
137137
// 2nd, 3rd, ..., Nth name: reserve exactly one more, then emplace
138138
template <typename T>
139139
inline void r_vector<T>::push_back(const named_arg& value) {
140-
push_back(value.value());
141-
142140
cpp11::writable::strings nms(names());
143141

144-
if (nms.size() == 0) {
145-
nms.reserve(1);
146-
nms.emplace_back(value.name());
147-
} else {
148-
nms.reserve(nms.size() + 1);
149-
nms.emplace_back(value.name());
150-
}
142+
nms.reserve(nms.size() + 1);
143+
nms.push_back(value.name());
151144

152145
names() = nms;
153146
}

0 commit comments

Comments
 (0)