Skip to content

Commit ece4b28

Browse files
committed
Use const reference parameters for efficiency to not make copies
Flagged by Coverity Scan.
1 parent e823d7d commit ece4b28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

judge/runpipe.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ int main(int argc, char **argv) {
912912
}
913913

914914
// The exit status should match the one of the first command.
915-
auto main_process = state.main_process();
915+
auto &main_process = state.main_process();
916916
int exit_code = main_process.exit_code();
917917
if (exit_code != -1) {
918918
return exit_code;

sql/files/defaultdata/compare/compare.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool equal_case_insensitive(std::string a, std::string b)
9090
/* Test two floating-point numbers for equality, accounting for +/-INF, NaN, and precision.
9191
* Float `jval` is considered the reference value for relative error.
9292
*/
93-
void compare_float(std::string judge, std::string team, flt jval, flt tval, flt float_abs_tol, flt float_rel_tol, std::string extra_msg) {
93+
void compare_float(const std::string &judge, const std::string &team, flt jval, flt tval, flt float_abs_tol, flt float_rel_tol, const std::string &extra_msg) {
9494
/* Finite values are compared with some tolerance */
9595
if (std::isfinite(tval) && std::isfinite(jval)) {
9696
flt absdiff = fabsl(tval-jval);

0 commit comments

Comments
 (0)