Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: src/list-inl.h

Issue 6901090: Add support for startup data (snapshot) compression. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The version I'll commit Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/list.h ('k') | src/mksnapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/list.h ('k') | src/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698