Skip to content

Commit 15acc64

Browse files
committed
fix clang-tidy
1 parent e68ab2c commit 15acc64

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/runtime/fault_injector.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ void fault_injector::install(service_spec &spec)
320320
read_config("task..default", default_opt, nullptr);
321321

322322
for (int i = 0; i <= dsn::task_code::max(); i++) {
323-
if (i == TASK_CODE_INVALID)
323+
if (i == TASK_CODE_INVALID) {
324324
continue;
325+
}
325326

326327
std::string section_name = fmt::format("task.{}", dsn::task_code(i));
327328
task_spec *spec = task_spec::get(i);
@@ -330,8 +331,9 @@ void fault_injector::install(service_spec &spec)
330331
fj_opt &lopt = s_fj_opts[i];
331332
read_config(section_name.c_str(), lopt, &default_opt);
332333

333-
if (!lopt.fault_injection_enabled)
334+
if (!lopt.fault_injection_enabled) {
334335
continue;
336+
}
335337

336338
spec->on_task_enqueue.put_back(fault_on_task_enqueue, "fault_injector");
337339
spec->on_task_begin.put_back(fault_on_task_begin, "fault_injector");

src/task/task_engine.sim.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void sim_lock_provider::unlock()
191191
}
192192

193193
sim_lock_nr_provider::sim_lock_nr_provider(lock_nr_provider *inner_provider)
194-
: lock_nr_provider(inner_provider), _current_holder(-1), _lock_depth(0), _sema(1, nullptr)
194+
: lock_nr_provider(inner_provider), _lock_depth(0), _current_holder(-1), _sema(1, nullptr)
195195
{
196196
}
197197

src/task/task_engine.sim.h

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class sim_lock_provider : public lock_provider
101101
int _lock_depth; // 0 for not locked;
102102
int _current_holder; // -1 for invalid
103103
sim_semaphore_provider _sema;
104+
105+
DISALLOW_COPY_AND_ASSIGN(sim_lock_provider);
106+
DISALLOW_MOVE_AND_ASSIGN(sim_lock_provider);
104107
};
105108

106109
class sim_lock_nr_provider : public lock_nr_provider

src/task/task_spec.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,23 @@ bool task_spec::init()
197197

198198
task_spec default_spec(
199199
0, "placeholder", TASK_TYPE_COMPUTE, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT);
200-
if (!read_config("task..default", default_spec, nullptr))
200+
if (!read_config("task..default", default_spec, nullptr)) {
201201
return false;
202+
}
202203

203204
for (int code = 0; code <= dsn::task_code::max(); code++) {
204-
if (code == TASK_CODE_INVALID)
205+
if (code == TASK_CODE_INVALID) {
205206
continue;
207+
}
206208

207209
std::string section_name =
208210
std::string("task.") + std::string(dsn::task_code(code).to_string());
209211
task_spec *spec = task_spec::get(code);
210212
CHECK_NOTNULL(spec, "");
211213

212-
if (!read_config(section_name.c_str(), *spec, &default_spec))
214+
if (!read_config(section_name.c_str(), *spec, &default_spec)) {
213215
return false;
216+
}
214217

215218
if (code == TASK_CODE_EXEC_INLINED) {
216219
spec->allow_inline = true;

0 commit comments

Comments
 (0)