diff options
author | Elliott Hughes <enh@google.com> | 2018-01-19 15:45:23 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-01-19 15:56:12 -0800 |
commit | 5cec377f49d6429b19895eb632225cd757ea611e (patch) | |
tree | bcd08fe1e6b656a5a4e235a225fbe88feb54a112 /benchmarks/bionic_benchmarks.cpp | |
parent | 0d63a3c233040af004cc470d5f76547f3adc0148 (diff) |
Address a bunch of clang-tidy complaints.
There were a bunch more unreasonable/incorrect ones, but these ones
seemed legit. Nothing very interesting, though.
Bug: N/A
Test: ran tests, benchmarks
Change-Id: If66971194d4a7b4bf6d0251bedb88e8cdc88a76f
Diffstat (limited to 'benchmarks/bionic_benchmarks.cpp')
-rw-r--r-- | benchmarks/bionic_benchmarks.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/bionic_benchmarks.cpp b/benchmarks/bionic_benchmarks.cpp index fe7a1b13e..d8635cda4 100644 --- a/benchmarks/bionic_benchmarks.cpp +++ b/benchmarks/bionic_benchmarks.cpp @@ -305,7 +305,7 @@ args_vector_t* ResolveArgs(args_vector_t* to_populate, std::string args, } void RegisterGoogleBenchmarks(bench_opts_t primary_opts, bench_opts_t secondary_opts, - std::string fn_name, args_vector_t* run_args) { + const std::string& fn_name, args_vector_t* run_args) { if (g_str_to_func.find(fn_name) == g_str_to_func.end()) { errx(1, "ERROR: No benchmark for function %s", fn_name.c_str()); } @@ -320,7 +320,7 @@ void RegisterGoogleBenchmarks(bench_opts_t primary_opts, bench_opts_t secondary_ } benchmark_func_t benchmark_function = g_str_to_func.at(fn_name).first; - for (std::vector<int> args : (*run_args)) { + for (const std::vector<int>& args : (*run_args)) { auto registration = benchmark::RegisterBenchmark(fn_name.c_str(), LockAndRun, benchmark_function, cpu_to_use)->Args(args); @@ -335,13 +335,13 @@ void RegisterCliBenchmarks(bench_opts_t cmdline_opts, // Register any of the extra benchmarks that were specified in the options. args_vector_t arg_vector; args_vector_t* run_args = &arg_vector; - for (std::string extra_fn : cmdline_opts.extra_benchmarks) { + for (const std::string& extra_fn : cmdline_opts.extra_benchmarks) { android::base::Trim(extra_fn); - size_t first_space_pos = extra_fn.find(" "); + size_t first_space_pos = extra_fn.find(' '); std::string fn_name = extra_fn.substr(0, first_space_pos); std::string cmd_args; if (first_space_pos != std::string::npos) { - cmd_args = extra_fn.substr(extra_fn.find(" ") + 1); + cmd_args = extra_fn.substr(extra_fn.find(' ') + 1); } else { cmd_args = ""; } |