QuackatronHQ / Gigarepo

Unnecessary expensive copy of loop-based variable CXX-P2004
Performance
Major
1 occurrence in this check
the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference
25bool employee_exist(std::vector<EmployeeDetails> employee_details,
26                    std::string employee_name) {
27  // use auto& to avoid copy of employee_details
28  for (const auto employee_detail : employee_details)29    if (employee_name.compare(employee_detail.name))
30      return true;
31