update_engine: Replace vector<Extent> with RepeatedPtrField<Extent>
This patch removes references to vector<Extent> and replaces them with
RepeatedPtrField in payload_consumer. Extent itself is a protobuf item
and it makes sense to use google::protobuf::RepeatedPtrField instead of
vector because then we won't have any extra copy to vector. We can
directly use the list of extents given in the payload protobuf.
Also removed references to vector in files which did not use vector.
BUG=chromium:766397
TEST=FEATURES="test" emerge-amd64-generic update_engine
Change-Id: I1f12332ff4d6303c1e4b7470bb87bf934acdf81a
Reviewed-on: https://chromium-review.googlesource.com/672006
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
diff --git a/payload_consumer/xz_extent_writer.cc b/payload_consumer/xz_extent_writer.cc
index 4bd893d..343ed80 100644
--- a/payload_consumer/xz_extent_writer.cc
+++ b/payload_consumer/xz_extent_writer.cc
@@ -16,7 +16,7 @@
#include "update_engine/payload_consumer/xz_extent_writer.h"
-using std::vector;
+using google::protobuf::RepeatedPtrField;
namespace chromeos_update_engine {
@@ -47,7 +47,7 @@
return "<unknown xz error>";
}
#undef __XZ_ERROR_STRING_CASE
-};
+}
} // namespace
XzExtentWriter::~XzExtentWriter() {
@@ -55,7 +55,7 @@
}
bool XzExtentWriter::Init(FileDescriptorPtr fd,
- const vector<Extent>& extents,
+ const RepeatedPtrField<Extent>& extents,
uint32_t block_size) {
stream_ = xz_dec_init(XZ_DYNALLOC, kXzMaxDictSize);
TEST_AND_RETURN_FALSE(stream_ != nullptr);