Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54424 - /trunk/core/libycp/src/YCPBuiltinList.cc
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 11:57:35 -0000
  • Message-id: <E1LKX2V-00051G-3b@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 12:57:34 2009
New Revision: 54424

URL: http://svn.opensuse.org/viewcvs/yast?rev=54424&view=rev
Log:
- use back_insert_iterator

Modified:
trunk/core/libycp/src/YCPBuiltinList.cc

Modified: trunk/core/libycp/src/YCPBuiltinList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPBuiltinList.cc?rev=54424&r1=54423&r2=54424&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinList.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinList.cc Wed Jan 7 12:57:34 2009
@@ -1217,14 +1217,9 @@
{
// see http://www.sgi.com/tech/stl/set_difference.html

- vector<YCPValue> r;
- back_insert_iterator< vector<YCPValue> > bii(r);
-
- set_difference(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
-
YCPList ret;
- for(vector<YCPValue>::iterator it = r.begin(); it != r.end(); it++)
- ret->add(*it);
+ back_insert_iterator<YCPList> bii(ret);
+ set_difference(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
return ret;
}

@@ -1234,14 +1229,9 @@
{
// see http://www.sgi.com/tech/stl/set_symmetric_difference.html

- vector<YCPValue> r;
- back_insert_iterator< vector<YCPValue> > bii(r);
-
- set_symmetric_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
-
YCPList ret;
- for(vector<YCPValue>::iterator it = r.begin(); it != r.end(); it++)
- ret->add(*it);
+ back_insert_iterator<YCPList> bii(ret);
+ set_symmetric_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
return ret;
}

@@ -1251,14 +1241,9 @@
{
// see http://www.sgi.com/tech/stl/set_intersection.html

- vector<YCPValue> r;
- back_insert_iterator< vector<YCPValue> > bii(r);
-
- set_intersection(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
-
YCPList ret;
- for(vector<YCPValue>::iterator it = r.begin(); it != r.end(); it++)
- ret->add(*it);
+ back_insert_iterator<YCPList> bii(ret);
+ set_intersection(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
return ret;
}

@@ -1268,14 +1253,9 @@
{
// see http://www.sgi.com/tech/stl/set_union.html

- vector<YCPValue> r;
- back_insert_iterator< vector<YCPValue> > bii(r);
-
- set_union(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
-
YCPList ret;
- for(vector<YCPValue>::iterator it = r.begin(); it != r.end(); it++)
- ret->add(*it);
+ back_insert_iterator<YCPList> bii(ret);
+ set_union(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
return ret;
}


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages