summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2016-08-01 20:23:10 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-01 20:23:10 +0000
commit4c4fa90462afc8b187a65238f26d9b66db66e428 (patch)
tree06f6b305245ef7a0c4155c132e00d90f7051a9a4 /fastboot
parent740c4788a0669989358f22fc822e1c1d206a4f9f (diff)
parent4efbce14b5b9075f0c190feb6603464f6207a24e (diff)
downloadsystem_core-4c4fa90462afc8b187a65238f26d9b66db66e428.tar.gz
system_core-4c4fa90462afc8b187a65238f26d9b66db66e428.tar.bz2
system_core-4c4fa90462afc8b187a65238f26d9b66db66e428.zip
Merge \"Fix clang-tidy performance warnings in syste/core.\"
am: 4efbce14b5 Change-Id: I84f6b0134fae6e9f40710f243f4825e3f31fa15f
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.cpp4
-rw-r--r--fastboot/socket_test.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index aeef43d1e..f622ea7b1 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -895,7 +895,7 @@ static std::string verify_slot(Transport* transport, const char *slot) {
}
static void do_for_partition(Transport* transport, const char *part, const char *slot,
- std::function<void(const std::string&)> func, bool force_slot) {
+ const std::function<void(const std::string&)>& func, bool force_slot) {
std::string has_slot;
std::string current_slot;
@@ -927,7 +927,7 @@ static void do_for_partition(Transport* transport, const char *part, const char
* partition does not support slots.
*/
static void do_for_partitions(Transport* transport, const char *part, const char *slot,
- std::function<void(const std::string&)> func, bool force_slot) {
+ const std::function<void(const std::string&)>& func, bool force_slot) {
std::string has_slot;
if (slot && strcmp(slot, "all") == 0) {
diff --git a/fastboot/socket_test.cpp b/fastboot/socket_test.cpp
index affbdfd88..373abc35e 100644
--- a/fastboot/socket_test.cpp
+++ b/fastboot/socket_test.cpp
@@ -34,7 +34,7 @@ static constexpr int kTestTimeoutMs = 3000;
// Creates connected sockets |server| and |client|. Returns true on success.
bool MakeConnectedSockets(Socket::Protocol protocol, std::unique_ptr<Socket>* server,
std::unique_ptr<Socket>* client,
- const std::string hostname = "localhost") {
+ const std::string& hostname = "localhost") {
*server = Socket::NewServer(protocol, 0);
if (*server == nullptr) {
ADD_FAILURE() << "Failed to create server.";