Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingchun Lai committed Nov 29, 2024
1 parent 1476917 commit cdb8ec5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/meta/meta_state_service_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void meta_state_service_simple::write_log(blob &&log_blob,
CHECK(log_succeed, "we cannot handle logging failure now");
__err_cb_bind_and_enqueue(task, internal_operation(), 0);
}));
auto continuation_task_ptr = continuation_task.get();
auto* continuation_task_ptr = continuation_task.get();
_task_queue.emplace(std::move(continuation_task));
_log_lock.unlock();

Expand Down Expand Up @@ -525,7 +525,7 @@ task_ptr meta_state_service_simple::get_children(const std::string &node,
result.push_back(child_pair.first);
}
return tasking::enqueue(
cb_code, tracker, [=]() mutable { cb_get_children(ERR_OK, std::move(result)); });
cb_code, tracker, [=]() mutable { cb_get_children(ERR_OK, result); });
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/replica/prepare_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ void prepare_list::commit(decree d, commit_type ct)
return;
}
case COMMIT_ALL_READY: {
if (d != last_committed_decree() + 1)
if (d != last_committed_decree() + 1) {
return;
}

mutation_ptr mu = get_mutation_by_decree(last_committed_decree() + 1);

Expand Down
7 changes: 5 additions & 2 deletions src/test/bench_test/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ void benchmark::write_random(thread_arg *thread)
uint64_t bytes = 0;
for (int i = 0; i < FLAGS_benchmark_num; i++) {
// generate hash key and sort key
std::string hashkey, sortkey, value;
std::string hashkey;
std::string sortkey;
std::string value;
generate_kv_pair(hashkey, sortkey, value);

// write to pegasus
Expand All @@ -185,7 +187,8 @@ void benchmark::write_random(thread_arg *thread)
if (ret == ::pegasus::PERR_OK) {
bytes += FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size;
break;
} else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
}
if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));
dsn_exit(1);
} else {
Expand Down

0 comments on commit cdb8ec5

Please sign in to comment.