liblp: convert more functions to use string_view (#3)
Test: builds
Change-Id: Ia448993ff61d46ae2280e3d3c02b5e84dd51f37c
diff --git a/fs_mgr/liblp/builder.cpp b/fs_mgr/liblp/builder.cpp
index c91fbe4..f8c492d 100644
--- a/fs_mgr/liblp/builder.cpp
+++ b/fs_mgr/liblp/builder.cpp
@@ -426,7 +426,7 @@
return true;
}
-bool MetadataBuilder::AddGroup(const std::string& group_name, uint64_t maximum_size) {
+bool MetadataBuilder::AddGroup(std::string_view group_name, uint64_t maximum_size) {
if (FindGroup(group_name)) {
LERROR << "Group already exists: " << group_name;
return false;
diff --git a/fs_mgr/liblp/include/liblp/builder.h b/fs_mgr/liblp/include/liblp/builder.h
index e3b591a..5ab42f5 100644
--- a/fs_mgr/liblp/include/liblp/builder.h
+++ b/fs_mgr/liblp/include/liblp/builder.h
@@ -91,7 +91,7 @@
friend class MetadataBuilder;
public:
- explicit PartitionGroup(const std::string& name, uint64_t maximum_size)
+ explicit PartitionGroup(std::string_view name, uint64_t maximum_size)
: name_(name), maximum_size_(maximum_size) {}
const std::string& name() const { return name_; }
@@ -206,7 +206,7 @@
// total space used by all partitions in the group.
//
// This can fail and return false if the group already exists.
- bool AddGroup(const std::string& group_name, uint64_t maximum_size);
+ bool AddGroup(std::string_view group_name, uint64_t maximum_size);
// Export metadata so it can be serialized to an image, to disk, or mounted
// via device-mapper.