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

Commit 4efbce14 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix clang-tidy performance warnings in syste/core."

parents 9f05901b 8f7b9e3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ TEST(adb_utils, adb_dirname) {
  EXPECT_EQ("/system/bin", adb_dirname("/system/bin/sh/"));
}

void test_mkdirs(const std::string basepath) {
void test_mkdirs(const std::string& basepath) {
  // Test creating a directory hierarchy.
  EXPECT_TRUE(mkdirs(basepath));
  // Test finding an existing directory hierarchy.
+3 −2
Original line number Diff line number Diff line
@@ -1275,9 +1275,10 @@ static std::string find_product_out_path(const std::string& hint) {
        return hint;
    }

    // If there are any slashes in it, assume it's a relative path;
    // If any of the OS_PATH_SEPARATORS is found, assume it's a relative path;
    // make it absolute.
    if (hint.find_first_of(OS_PATH_SEPARATORS) != std::string::npos) {
    // NOLINT: Do not complain if OS_PATH_SEPARATORS has only one character.
    if (hint.find_first_of(OS_PATH_SEPARATORS) != std::string::npos) {  // NOLINT
        std::string cwd;
        if (!getcwd(&cwd)) {
            fprintf(stderr, "adb: getcwd failed: %s\n", strerror(errno));
+1 −1
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ class SyncConnection {
typedef void (sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char* name);

static bool sync_ls(SyncConnection& sc, const char* path,
                    std::function<sync_ls_cb> func) {
                    const std::function<sync_ls_cb>& func) {
    if (!sc.SendRequest(ID_LIST, path)) return false;

    while (true) {
+2 −2
Original line number Diff line number Diff line
@@ -835,7 +835,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;

@@ -867,7 +867,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) {
+1 −1
Original line number Diff line number Diff line
@@ -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.";
Loading