summaryrefslogtreecommitdiff
path: root/adb/daemon/file_sync_service.cpp
diff options
context:
space:
mode:
authorGreg Kaiser <gkaiser@google.com>2019-03-26 11:58:53 -0700
committerGreg Kaiser <gkaiser@google.com>2019-03-26 12:00:19 -0700
commite2125fdeb1f72f5599853f82fc7ed2be9d5ee015 (patch)
tree433739e6796aa6716c4f00088250b0430ad1e55d /adb/daemon/file_sync_service.cpp
parentd2c4eb0daeb3a668e6127a9f932bf313a0840be1 (diff)
adb: Avoid extra std::string copies
When a function argument takes a std::string, it's inefficient to pass std::string::c_str(), since that creates an additional copy. So we change these calling sites. Test: TreeHugger Change-Id: I1c0fde7275eb3ebd3baf05ec62581b0243655608
Diffstat (limited to 'adb/daemon/file_sync_service.cpp')
-rw-r--r--adb/daemon/file_sync_service.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/daemon/file_sync_service.cpp b/adb/daemon/file_sync_service.cpp
index 29bd798d4..e82a51f2b 100644
--- a/adb/daemon/file_sync_service.cpp
+++ b/adb/daemon/file_sync_service.cpp
@@ -422,7 +422,7 @@ static bool do_send(int s, const std::string& spec, std::vector<char>& buffer) {
bool result;
uint32_t timestamp;
if (S_ISLNK(mode)) {
- result = handle_send_link(s, path.c_str(), &timestamp, buffer);
+ result = handle_send_link(s, path, &timestamp, buffer);
} else {
// Copy user permission bits to "group" and "other" permissions.
mode &= 0777;