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

@ -311,18 +311,16 @@ void eliminateDoubleNegations(ast::Precondition &precondition)
const auto handleNot =
[&](ast::NotPointer<ast::Precondition> &not_)
{
if (not_->argument.is<ast::NotPointer<ast::Precondition>>())
{
eliminateDoubleNegations(not_->argument);
if (not_->argument.is<ast::NotPointer<ast::Precondition>>())
{
// 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 =