Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2ff970b authored by Yifan Hong's avatar Yifan Hong
Browse files

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

Test: builds
Change-Id: Iad041762beb9eeab8b2174ab48a50677754248b5
parent a550e7f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);