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

Commit b49d9e19 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

fastboot: Avoid extra std::string copies

The function do_for_partitions() takes a const std::string
reference, so it's inefficient to pass a std::string::c_str().

Test: TreeHugger
Change-Id: Ia84ed9ec691ee2f524c61dd25a81b2995bb0bb33
parent e2125fde
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1805,7 +1805,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
            auto format = [&](const std::string& partition) {
                fb_perform_format(partition, 0, type_override, size_override, "");
            };
            do_for_partitions(partition.c_str(), slot_override, format, true);
            do_for_partitions(partition, slot_override, format, true);
        } else if (command == "signature") {
            std::string filename = next_arg(&args);
            std::vector<char> data;
@@ -1876,7 +1876,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
                }
                do_flash(partition.c_str(), fname.c_str());
            };
            do_for_partitions(pname.c_str(), slot_override, flash, true);
            do_for_partitions(pname, slot_override, flash, true);
        } else if (command == "flash:raw") {
            std::string partition = next_arg(&args);
            std::string kernel = next_arg(&args);