]> www.ginac.de Git - ginac.git/blobdiff - ginac/color.cpp
Rename array of precomputed data in test suite.
[ginac.git] / ginac / color.cpp
index 9a0d353460d87de519f2dc2fca362f3fa0669a9f..dcc106dacda8309fec7f86c90ed295225a9f805d 100644 (file)
@@ -86,11 +86,11 @@ color::color(const ex & b, const ex & i1, unsigned char rl) : inherited(b, i1),
 {
 }
 
-color::color(unsigned char rl, const exvector & v, bool discardable) : inherited(not_symmetric(), v, discardable), representation_label(rl)
+color::color(unsigned char rl, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl)
 {
 }
 
-color::color(unsigned char rl, std::auto_ptr<exvector> vp) : inherited(not_symmetric(), vp), representation_label(rl)
+color::color(unsigned char rl, exvector && v) : inherited(not_symmetric(), std::move(v)), representation_label(rl)
 {
 }
 
@@ -166,11 +166,9 @@ ex color::eval_ncmul(const exvector & v) const
        s.reserve(v.size());
 
        // Remove superfluous ONEs
-       exvector::const_iterator it = v.begin(), itend = v.end();
-       while (it != itend) {
-               if (!is_a<su3one>(it->op(0)))
-                       s.push_back(*it);
-               it++;
+       for (auto & it : v) {
+               if (!is_a<su3one>(it.op(0)))
+                       s.push_back(it);
        }
 
        if (s.empty())
@@ -184,9 +182,9 @@ ex color::thiscontainer(const exvector & v) const
        return color(representation_label, v);
 }
 
-ex color::thiscontainer(std::auto_ptr<exvector> vp) const
+ex color::thiscontainer(exvector && v) const
 {
-       return color(representation_label, vp);
+       return color(representation_label, std::move(v));
 }
 
 /** Given a vector iv3 of three indices and a vector iv2 of two indices that
@@ -625,9 +623,9 @@ ex color_trace(const ex & e, const lst & rll)
 {
        // Convert list to set
        std::set<unsigned char> rls;
-       for (lst::const_iterator i = rll.begin(); i != rll.end(); ++i) {
-               if (i->info(info_flags::nonnegint))
-                       rls.insert(ex_to<numeric>(*i).to_int());
+       for (auto & it : rll) {
+               if (it.info(info_flags::nonnegint))
+                       rls.insert(ex_to<numeric>(it).to_int());
        }
 
        return color_trace(e, rls);