From 85b4f26ece5572d156830aaa0fea11d5a0292663 Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Mon, 11 May 2020 12:04:35 +0200
Subject: [PATCH] Minor fixes: take into account @jmirabel comments.

---
 doc/Doxyfile.extra.in |  2 --
 src/problem-solver.cc | 20 ++++----------------
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/doc/Doxyfile.extra.in b/doc/Doxyfile.extra.in
index 6ad3914..9ca64de 100644
--- a/doc/Doxyfile.extra.in
+++ b/doc/Doxyfile.extra.in
@@ -8,5 +8,3 @@ ALIASES   += Link{1}="\ref \1"
 ALIASES   += Link{2}="\ref \1 \"\2\""
 ALIASES   += LHPP{2}="\Link{hpp::\1::\2,\2}"
 ALIASES   += LPinocchio{1}="\LHPP{pinocchio,\1}"
-
-EXTRA_PACKAGES = {amsmath}
diff --git a/src/problem-solver.cc b/src/problem-solver.cc
index a7f9586..43e64d8 100644
--- a/src/problem-solver.cc
+++ b/src/problem-solver.cc
@@ -250,10 +250,7 @@ namespace hpp {
         if (!robot_->jointAndShapes.has (*it1))
           throw std::runtime_error ("First list of triangles not found.");
         l = robot_->jointAndShapes.get (*it1);
-        for (JointAndShapes_t::const_iterator it(l.begin()); it!=l.end();++it)
-        {
-          objectSurfaces.push_back(*it);
-        }
+        objectSurfaces.insert(objectSurfaces.end(), l.begin(), l.end());
       }
 
       for (StringList_t::const_iterator it2 = surface2.begin ();
@@ -265,10 +262,7 @@ namespace hpp {
         else if (jointAndShapes.has (*it2))
           l = jointAndShapes.get (*it2);
         else throw std::runtime_error ("Second list of triangles not found.");
-        for (JointAndShapes_t::const_iterator it(l.begin()); it!=l.end();++it)
-        {
-          floorSurfaces.push_back(*it);
-        }
+        floorSurfaces.insert(floorSurfaces.end(), l.begin(), l.end());
       }
 
       typedef hpp::constraints::explicit_::ConvexShapeContact Constraint_t;
@@ -311,10 +305,7 @@ namespace hpp {
         if (!robot_->jointAndShapes.has (*it1))
           throw std::runtime_error ("First list of triangles not found.");
         l = robot_->jointAndShapes.get (*it1);
-        for (JointAndShapes_t::const_iterator it(l.begin()); it!=l.end();++it)
-        {
-          objectSurfaces.push_back(*it);
-        }
+        objectSurfaces.insert(objectSurfaces.end(), l.begin(), l.end());
       }
 
       for (StringList_t::const_iterator it2 = surface2.begin ();
@@ -326,10 +317,7 @@ namespace hpp {
         else if (jointAndShapes.has (*it2))
           l = jointAndShapes.get (*it2);
         else throw std::runtime_error ("Second list of triangles not found.");
-        for (JointAndShapes_t::const_iterator it(l.begin()); it!=l.end();++it)
-        {
-          floorSurfaces.push_back(*it);
-        }
+        floorSurfaces.insert(floorSurfaces.end(), l.begin(), l.end());
       }
 
       hpp::constraints::ConvexShapeContactPtr_t cvxShape
-- 
GitLab