Minor refactoring.
This commit is contained in:
parent
12efe41551
commit
4d59732263
@ -312,17 +312,15 @@ void eliminateDoubleNegations(ast::Precondition &precondition)
|
|||||||
const auto handleNot =
|
const auto handleNot =
|
||||||
[&](ast::NotPointer<ast::Precondition> ¬_)
|
[&](ast::NotPointer<ast::Precondition> ¬_)
|
||||||
{
|
{
|
||||||
|
eliminateDoubleNegations(not_->argument);
|
||||||
|
|
||||||
if (not_->argument.is<ast::NotPointer<ast::Precondition>>())
|
if (not_->argument.is<ast::NotPointer<ast::Precondition>>())
|
||||||
{
|
{
|
||||||
eliminateDoubleNegations(not_->argument);
|
|
||||||
|
|
||||||
// As the parent contains the argument, the argument needs to be saved before overwriting the parent
|
// As the parent contains the argument, the argument needs to be saved before overwriting the parent
|
||||||
// TODO: check whether this workaround can be avoided
|
// TODO: check whether this workaround can be avoided
|
||||||
auto argument = std::move(not_->argument.get<ast::NotPointer<ast::Precondition>>());
|
auto argument = std::move(not_->argument.get<ast::NotPointer<ast::Precondition>>());
|
||||||
precondition = std::move(argument);
|
precondition = std::move(argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
eliminateDoubleNegations(not_->argument);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handleOr =
|
const auto handleOr =
|
||||||
|
Reference in New Issue
Block a user