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

View File

@ -312,17 +312,15 @@ void eliminateDoubleNegations(ast::Precondition &precondition)
const auto handleNot = const auto handleNot =
[&](ast::NotPointer<ast::Precondition> &not_) [&](ast::NotPointer<ast::Precondition> &not_)
{ {
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 =