[PPL-devel] [GIT] ppl/ppl(floating_point): Do not use std::swap(): use Linear_Expression::swap() instead.

Roberto Bagnara bagnara at cs.unipr.it
Mon Aug 17 18:19:42 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: 73a33367e029c455c60393636746ae766ffcd03d
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=73a33367e029c455c60393636746ae766ffcd03d

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Mon Aug 17 17:55:53 2009 +0200

Do not use std::swap(): use Linear_Expression::swap() instead.

---

 src/Linear_Expression.cc |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Linear_Expression.cc b/src/Linear_Expression.cc
index de971b2..9816671 100644
--- a/src/Linear_Expression.cc
+++ b/src/Linear_Expression.cc
@@ -286,10 +286,10 @@ PPL::operator+=(Linear_Expression& e1, const Linear_Expression& e2) {
     for (dimension_type i = e2_size; i-- > 0; )
       e1[i] += e2[i];
   else {
-    Linear_Expression e(e2);
+    Linear_Expression new_e(e2);
     for (dimension_type i = e1_size; i-- > 0; )
-      e[i] += e1[i];
-    std::swap(e1, e);
+      new_e[i] += e1[i];
+    e1.swap(new_e);
   }
   return e1;
 }
@@ -305,7 +305,7 @@ PPL::operator+=(Linear_Expression& e, const Variable v) {
   const dimension_type e_size = e.size();
   if (e_size <= v_space_dim) {
     Linear_Expression new_e(e, v_space_dim+1);
-    std::swap(e, new_e);
+    e.swap(new_e);
   }
   ++e[v_space_dim];
   return e;
@@ -320,10 +320,10 @@ PPL::operator-=(Linear_Expression& e1, const Linear_Expression& e2) {
     for (dimension_type i = e2_size; i-- > 0; )
       e1[i] -= e2[i];
   else {
-    Linear_Expression e(e1, e2_size);
+    Linear_Expression new_e(e1, e2_size);
     for (dimension_type i = e2_size; i-- > 0; )
-      e[i] -= e2[i];
-    std::swap(e1, e);
+      new_e[i] -= e2[i];
+    e1.swap(new_e);
   }
   return e1;
 }
@@ -339,7 +339,7 @@ PPL::operator-=(Linear_Expression& e, const Variable v) {
   const dimension_type e_size = e.size();
   if (e_size <= v_space_dim) {
     Linear_Expression new_e(e, v_space_dim+1);
-    std::swap(e, new_e);
+    e.swap(new_e);
   }
   --e[v_space_dim];
   return e;




More information about the PPL-devel mailing list