diff --git a/ortools/linear_solver/proto_solver/highs_proto_solver.cc b/ortools/linear_solver/proto_solver/highs_proto_solver.cc index 7d91a916e9..487e8b6313 100644 --- a/ortools/linear_solver/proto_solver/highs_proto_solver.cc +++ b/ortools/linear_solver/proto_solver/highs_proto_solver.cc @@ -186,13 +186,10 @@ absl::StatusOr HighsSolveProto( } // Constraint names. - for (int c = 0; c < model.constraint_size(); ++c) { - const MPConstraintProto& constraint = model.constraint(c); - std::string constraint_name_str = ""; - if (!constraint.name().empty()) { - constraint_name_str = constraint.name(); - highs.passRowName(c, constraint_name_str); - } + std::string constraint_name_str = ""; + if (!constraint.name().empty()) { + constraint_name_str = constraint.name(); + highs.passRowName(c, constraint_name_str); } }