patrick
/
plasp
Archived
1
0
Fork 0

Minor refactoring.

This commit is contained in:
Patrick Lühne 2017-06-24 18:37:49 +02:00
parent 12efe41551
commit 4d59732263
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
1 changed files with 2 additions and 4 deletions

View File

@ -312,17 +312,15 @@ void eliminateDoubleNegations(ast::Precondition &precondition)
const auto handleNot =
[&](ast::NotPointer<ast::Precondition> &not_)
{
eliminateDoubleNegations(not_->argument);
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
// TODO: check whether this workaround can be avoided
auto argument = std::move(not_->argument.get<ast::NotPointer<ast::Precondition>>());
precondition = std::move(argument);
}
eliminateDoubleNegations(not_->argument);
};
const auto handleOr =