liblp: convert more functions to use string_view (#4)

Test: builds
Change-Id: Iad041762beb9eeab8b2174ab48a50677754248b5
This commit is contained in:
Yifan Hong 2019-09-13 14:24:44 -07:00
parent a550e7f412
commit c2ff970b17
2 changed files with 2 additions and 2 deletions

View File

@ -504,7 +504,7 @@ uint64_t MetadataBuilder::TotalSizeOfGroup(PartitionGroup* group) const {
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);

View File

@ -260,7 +260,7 @@ class MetadataBuilder {
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);