Skip to content

Commit bafd868

Browse files
committed
Refactor _get_name method in KNITROModel to use key instead of index for improved clarity
1 parent 54378a4 commit bafd868

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/pyoptinterface/knitro_model.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,12 +716,12 @@ class KNITROModel : public OnesideLinearConstraintMixin<KNITROModel>,
716716
_check_error(error);
717717
}
718718

719-
template <typename F>
720-
std::string _get_name(F get, KNINT index, const char *prefix) const
719+
template <typename F, typename K>
720+
std::string _get_name(F get, K key, const char *prefix) const
721721
{
722722
char name[1024];
723723
name[0] = '\0';
724-
int error = get(m_kc.get(), index, 1024, name);
724+
int error = get(m_kc.get(), key, 1024, name);
725725
_check_error(error);
726726

727727
if (name[0] != '\0')
@@ -730,7 +730,7 @@ class KNITROModel : public OnesideLinearConstraintMixin<KNITROModel>,
730730
}
731731
else
732732
{
733-
return fmt::format("{}{}", prefix, index);
733+
return fmt::format("{}{}", prefix, key);
734734
}
735735
}
736736

0 commit comments

Comments
 (0)