From 0a751dbea06df87903b96d38e725522341b0f65a Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Sat, 11 Jul 2020 18:49:41 +0200
Subject: [PATCH] [ManipulationPlanner] Remove tests that are always false.

  - add assert to check that tests are always false.
---
 src/manipulation-planner.cc | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/manipulation-planner.cc b/src/manipulation-planner.cc
index 5950d3b2..3e13a38c 100644
--- a/src/manipulation-planner.cc
+++ b/src/manipulation-planner.cc
@@ -398,10 +398,7 @@ namespace hpp {
               itn2 != knearest.end (); ++itn2) {
             bool _1to2 = (*itn1)->isOutNeighbor (*itn2);
             bool _2to1 = (*itn1)->isInNeighbor (*itn2);
-            if (_1to2 && _2to1) {
-              hppDout (info, "the two nodes are already connected");
-              continue;
-            }
+            assert (!_1to2 || !_2to1);
 
             const Configuration_t& q2 (*(*itn2)->configuration ());
             graph::StatePtr_t s2 = getState (graph, *itn2);
@@ -445,10 +442,7 @@ namespace hpp {
             continue;
           bool _1to2 = (*itn1)->isOutNeighbor (*itn2);
           bool _2to1 = (*itn1)->isInNeighbor (*itn2);
-          if (_1to2 && _2to1) {
-            hppDout (info, "the two nodes are already connected");
-            continue;
-          }
+          assert (!_1to2 || !_2to1);
           const Configuration_t& q2 (*(*itn2)->configuration ());
           graph::StatePtr_t s2 = getState (graph, *itn2);
           assert (q1 != q2);
-- 
GitLab