Skip to content

Commit 13e31f5

Browse files
Avoid unnecessary copies in report_util.cpp
Without the & here we copy the items we loop over, which is unnecessary in these cases.
1 parent 57a1383 commit 13e31f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/goto-checker/report_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static void output_fault_localization_plain(
473473
messaget &log)
474474
{
475475
log.result() << "\n** Most likely fault location:" << messaget::eom;
476-
for(const auto fault_location_pair : fault_locations)
476+
for(const auto &fault_location_pair : fault_locations)
477477
{
478478
output_fault_localization_plain(
479479
fault_location_pair.first, fault_location_pair.second, log);
@@ -509,7 +509,7 @@ static void output_fault_localization_xml(
509509
messaget &log)
510510
{
511511
xmlt dest("fault-localization");
512-
for(const auto fault_location_pair : fault_locations)
512+
for(const auto &fault_location_pair : fault_locations)
513513
{
514514
xmlt xml_diagnosis =
515515
xml(fault_location_pair.first, fault_location_pair.second, log);

0 commit comments

Comments
 (0)