Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54416 - in /trunk/core/libycp/src: YCPBuiltinList.cc YCPList.cc
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 11:26:10 -0000
  • Message-id: <E1LKWY6-0004lb-Pw@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 12:26:10 2009
New Revision: 54416

URL: http://svn.opensuse.org/viewcvs/yast?rev=54416&view=rev
Log:
- use ycpless instead of own functions

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

Modified: trunk/core/libycp/src/YCPBuiltinList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPBuiltinList.cc?rev=54416&r1=54415&r2=54416&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinList.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinList.cc Wed Jan 7 12:26:10 2009
@@ -1267,12 +1267,6 @@
return YCPNull();
}

-bool haha(YCPValue a, YCPValue b)
-{
- YCPOrder comp = a->compare (b);
- return comp == YO_LESS;
-}
-

static YCPValue
s_difference(const YCPList& a, const YCPList& b)
@@ -1282,7 +1276,7 @@
vector<YCPValue> r;
back_insert_iterator< vector<YCPValue> > bii(r);

- set_difference(a->begin(), a->end(), b->begin(), b->end(), bii, haha);
+ 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++)
@@ -1299,7 +1293,7 @@
vector<YCPValue> r;
back_insert_iterator< vector<YCPValue> > bii(r);

- set_symmetric_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
haha);
+ 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++)
@@ -1316,7 +1310,7 @@
vector<YCPValue> r;
back_insert_iterator< vector<YCPValue> > bii(r);

- set_intersection(a->begin(), a->end(), b->begin(), b->end(), bii, haha);
+ 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++)
@@ -1333,7 +1327,7 @@
vector<YCPValue> r;
back_insert_iterator< vector<YCPValue> > bii(r);

- set_union(a->begin(), a->end(), b->begin(), b->end(), bii, haha);
+ 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++)
@@ -1349,7 +1343,7 @@
{ "find", "flex (variable <flex>, const list <flex>, const block
<boolean>)", (void *)l_find, DECL_SYMBOL|DECL_FLEX
},
{ "prepend", "list <flex> (const list <flex>, const flex)",
(void *)l_prepend, DECL_FLEX },
{ "contains", "boolean (const list <flex>, const flex)",
(void *)l_contains, DECL_FLEX },
- { "setcontains","boolean (const list <flex>, const flex)",
(void *)l_setcontains, DECL_FLEX },
+ { "setcontains","boolean (const list <flex>, const flex)",
(void *)l_setcontains, DECL_FLEX },
{ "union", "list <any> (const list <any>, const list <any>)",
(void *)l_unionlist },
{ "+", "list <flex> (const list <flex>, const list <flex>)",
(void *)l_unionlist, DECL_FLEX },
{ "merge", "list <any> (const list <any>, const list <any>)",
(void *)l_mergelist },

Modified: trunk/core/libycp/src/YCPList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPList.cc?rev=54416&r1=54415&r2=54416&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPList.cc (original)
+++ trunk/core/libycp/src/YCPList.cc Wed Jan 7 12:26:10 2009
@@ -10,7 +10,7 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/

- File: YCPList.cc
+ File: YCPList.cc

Authors: Mathias Kettner <kettner@xxxxxxx>
Klaus Kaempf <kkaempf@xxxxxxx>
@@ -113,30 +113,19 @@
}


-static bool compareYCP (const YCPValue& y1, const YCPValue& y2)
-{
- return (y1->compare(y2)) == YO_LESS;
-}
-
-
void
YCPListRep::sortlist()
{
- std::sort (elements.begin (), elements.end (), compareYCP);
-}
-
-
-static bool lcompareYCP( const YCPValue& y1, const YCPValue& y2 )
-{
- return y1->compare(y2, true) == YO_LESS;
+ std::sort(elements.begin(), elements.end(), ycpless());
}


void YCPListRep::lsortlist()
{
- std::sort (elements.begin (), elements.end (), lcompareYCP);
+ std::sort (elements.begin(), elements.end(), ycpless(true));
}

+
void
YCPListRep::fsortlist(const YCPCodeCompare& cmp)
{

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

< Previous Next >
This Thread
  • No further messages