liblp: convert more functions to use string_view (#4)
Test: builds
Change-Id: Iad041762beb9eeab8b2174ab48a50677754248b5
diff --git a/fs_mgr/liblp/builder.cpp b/fs_mgr/liblp/builder.cpp
index ea3b58e..96068b1 100644
--- a/fs_mgr/liblp/builder.cpp
+++ b/fs_mgr/liblp/builder.cpp
@@ -504,7 +504,7 @@
return total;
}
-void MetadataBuilder::RemovePartition(const std::string& name) {
+void MetadataBuilder::RemovePartition(std::string_view name) {
for (auto iter = partitions_.begin(); iter != partitions_.end(); iter++) {
if ((*iter)->name() == name) {
partitions_.erase(iter);
diff --git a/fs_mgr/liblp/include/liblp/builder.h b/fs_mgr/liblp/include/liblp/builder.h
index 69885fe..4d7f81d 100644
--- a/fs_mgr/liblp/include/liblp/builder.h
+++ b/fs_mgr/liblp/include/liblp/builder.h
@@ -260,7 +260,7 @@
Partition* AddPartition(const std::string& name, uint32_t attributes);
// Delete a partition by name if it exists.
- void RemovePartition(const std::string& name);
+ void RemovePartition(std::string_view name);
// Find a partition by name. If no partition is found, nullptr is returned.
Partition* FindPartition(std::string_view name);