Make StringPiece to be std::string_view alias
Bug: 237583012
Test: build + boot + UTs
Change-Id: I849831f4466d3b9c7ec842b75256e7fcba77a0c0
diff --git a/tools/aapt2/io/ZipArchive.cpp b/tools/aapt2/io/ZipArchive.cpp
index 400269c..4a5385d 100644
--- a/tools/aapt2/io/ZipArchive.cpp
+++ b/tools/aapt2/io/ZipArchive.cpp
@@ -91,8 +91,8 @@
ZipFileCollection::ZipFileCollection() : handle_(nullptr) {}
-std::unique_ptr<ZipFileCollection> ZipFileCollection::Create(
- const StringPiece& path, std::string* out_error) {
+std::unique_ptr<ZipFileCollection> ZipFileCollection::Create(StringPiece path,
+ std::string* out_error) {
TRACE_CALL();
constexpr static const int32_t kEmptyArchive = -6;
@@ -130,8 +130,8 @@
continue;
}
- std::unique_ptr<IFile> file = util::make_unique<ZipFile>(
- collection->handle_, zip_data, android::Source(zip_entry_path, path.to_string()));
+ std::unique_ptr<IFile> file = util::make_unique<ZipFile>(collection->handle_, zip_data,
+ android::Source(zip_entry_path, path));
collection->files_by_name_[zip_entry_path] = file.get();
collection->files_.push_back(std::move(file));
}
@@ -144,8 +144,8 @@
return collection;
}
-IFile* ZipFileCollection::FindFile(const StringPiece& path) {
- auto iter = files_by_name_.find(path.to_string());
+IFile* ZipFileCollection::FindFile(StringPiece path) {
+ auto iter = files_by_name_.find(path);
if (iter != files_by_name_.end()) {
return iter->second;
}