Skip to content

Commit 38f396e

Browse files
Refactor new_gt function: simplify implementation by directly returning new_lt with reason parameter.
1 parent d96ed97 commit 38f396e

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/linspire.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,7 @@ namespace linspire
117117
return reason ? set_ub(slack, c_right, reason.value()) : set_ub(slack, c_right); // we are in the case `expr < c_right`..
118118
}
119119
}
120-
bool solver::new_gt(const utils::lin &lhs, const utils::lin &rhs, bool strict, std::optional<std::reference_wrapper<constraint>> reason) noexcept
121-
{
122-
if (reason)
123-
return new_lt(rhs, lhs, strict, *reason);
124-
else
125-
return new_lt(rhs, lhs, strict);
126-
}
120+
bool solver::new_gt(const utils::lin &lhs, const utils::lin &rhs, bool strict, std::optional<std::reference_wrapper<constraint>> reason) noexcept { return new_lt(rhs, lhs, strict, reason); }
127121

128122
void solver::retract(constraint &c) noexcept
129123
{

0 commit comments

Comments
 (0)