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

Commit 116d2ff5 authored by Yifan Hong's avatar Yifan Hong Committed by Gerrit Code Review
Browse files

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

parents 32017407 c2ff970b
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);