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

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

adb: Avoid a couple std::string constructions

With some internal API changing from "const char*" to
"const std::string&", we can change a couple calling sites to
directly pass a std::string reference, instead of getting the
c_str() version of the string.  This avoids us creating a
temporary std::string for the call.

Test: TreeHugger
Change-Id: I2fe0760ce8bf7d352010a341005356c0a801d351
parent f1e27502
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1097,14 +1097,14 @@ static bool remote_build_list(SyncConnection& sc, std::vector<copyinfo>* file_li
        }
    };

    if (!sync_ls(sc, rpath.c_str(), callback)) {
    if (!sync_ls(sc, rpath, callback)) {
        return false;
    }

    // Check each symlink we found to see whether it's a file or directory.
    for (copyinfo& link_ci : linklist) {
        struct stat st;
        if (!sync_stat_fallback(sc, link_ci.rpath.c_str(), &st)) {
        if (!sync_stat_fallback(sc, link_ci.rpath, &st)) {
            sc.Warning("stat failed for path %s: %s", link_ci.rpath.c_str(), strerror(errno));
            continue;
        }