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
This commit is contained in:
parent
e2125fdeb1
commit
b49d9e19dc
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue