Index: src/list-inl.h |
diff --git a/src/list-inl.h b/src/list-inl.h |
index eeaea65f80b61343c91f06b5299b69201c784265..8ef7514f4f61d5bad8b374d95f8aae8ab0cff296 100644 |
--- a/src/list-inl.h |
+++ b/src/list-inl.h |
@@ -46,10 +46,16 @@ void List<T, P>::Add(const T& element) { |
template<typename T, class P> |
void List<T, P>::AddAll(const List<T, P>& other) { |
- int result_length = length_ + other.length_; |
+ AddAll(other.ToVector()); |
+} |
+ |
+ |
+template<typename T, class P> |
+void List<T, P>::AddAll(const Vector<T>& other) { |
+ int result_length = length_ + other.length(); |
if (capacity_ < result_length) Resize(result_length); |
- for (int i = 0; i < other.length_; i++) { |
- data_[length_ + i] = other.data_[i]; |
+ for (int i = 0; i < other.length(); i++) { |
+ data_[length_ + i] = other.at(i); |
} |
length_ = result_length; |
} |