Fix warnings - #2483
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #2483 +/- ##
==========================================
- Coverage 79.55% 79.55% -0.01%
==========================================
Files 346 346
Lines 85401 85403 +2
==========================================
+ Hits 67942 67943 +1
- Misses 17459 17460 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Opt-Mucca
left a comment
There was a problem hiding this comment.
Support for this change! Will make my IDE happier.
| has_duplicate = !this->name2index.emplace(name[index], index).second; | ||
| for (size_t index = 0; index < name.size(); index++) { | ||
| has_duplicate = | ||
| !this->name2index.emplace(name[index], static_cast<int>(index)).second; |
There was a problem hiding this comment.
I see why this has to be name2index.emplace(name[index], static_cast<int>(index)) - since HighsNameHash::name2index is std::unordered_map<std::string, int>, but it seems odd to have the loop parameter index to be size_t. Yes, it fits with index < name.size(), but it looks confusing
I should have created HighsNameHash::name2index as std::unordered_map<std::string, HighsInt>, and then all "ints" would be HighsInt
Not a big issue
jajhall
left a comment
There was a problem hiding this comment.
Changes have been made to some long-established code, and I can't check whether some are correct. I have to trust that any errors would soon yield failure in unit/instance tests.
Fix some warnings concerned with type conversions / loss of precision reported here.