Skip to content

Commit

Permalink
fix compiler warnings
Browse files Browse the repository at this point in the history
- clarify if condition
- declare local function static
  • Loading branch information
svigerske committed Dec 21, 2024
1 parent 7db0525 commit 2130896
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lp_data/HighsInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@ bool Highs::hasRepeatedLinearObjectivePriorities(
// O(n^2), but who will have more than O(1) linear objectives!
HighsInt num_linear_objective = this->multi_linear_objective_.size();
if (num_linear_objective <= 0 ||
num_linear_objective <= 1 && !linear_objective)
(num_linear_objective <= 1 && !linear_objective))
return false;
for (HighsInt iObj0 = 0; iObj0 < num_linear_objective; iObj0++) {
HighsInt priority0 = this->multi_linear_objective_[iObj0].priority;
Expand All @@ -3630,8 +3630,8 @@ bool Highs::hasRepeatedLinearObjectivePriorities(
return false;
}

bool comparison(std::pair<HighsInt, HighsInt> x1,
std::pair<HighsInt, HighsInt> x2) {
static bool comparison(std::pair<HighsInt, HighsInt> x1,
std::pair<HighsInt, HighsInt> x2) {
return x1.first >= x2.first;
}

Expand Down

0 comments on commit 2130896

Please sign in to comment.