From 4d59732263ea2964bd5d9e8b0ca028b8eeb073c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 24 Jun 2017 18:37:49 +0200 Subject: [PATCH] Minor refactoring. --- .../src/pddlparse/detail/normalization/Reduction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp b/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp index 88dae1f..1abd73d 100644 --- a/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp +++ b/lib/pddlparse/src/pddlparse/detail/normalization/Reduction.cpp @@ -312,17 +312,15 @@ void eliminateDoubleNegations(ast::Precondition &precondition) const auto handleNot = [&](ast::NotPointer ¬_) { + eliminateDoubleNegations(not_->argument); + if (not_->argument.is>()) { - 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>()); precondition = std::move(argument); } - - eliminateDoubleNegations(not_->argument); }; const auto handleOr =