Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54422 - /trunk/core/libycp/src/YCPList.cc
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 11:49:49 -0000
  • Message-id: <E1LKWuz-0004wp-Nr@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 12:49:49 2009
New Revision: 54422

URL: http://svn.opensuse.org/viewcvs/yast?rev=54422&view=rev
Log:
- use find_if in constains

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

Modified: trunk/core/libycp/src/YCPList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPList.cc?rev=54422&r1=54421&r2=54422&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPList.cc (original)
+++ trunk/core/libycp/src/YCPList.cc Wed Jan 7 12:49:49 2009
@@ -14,6 +14,7 @@

Authors: Mathias Kettner <kettner@xxxxxxx>
Klaus Kaempf <kkaempf@xxxxxxx>
+ Arvin Schnell <aschnell@xxxxxxx>
Maintainer: Klaus Kaempf <kkaempf@xxxxxxx>

/-*/
@@ -102,14 +103,7 @@

bool YCPListRep::contains (const YCPValue& value) const
{
- for (vector <YCPValue>::const_iterator it = elements.begin ();
- it != elements.end (); it++)
- {
- if ((*it)->equal (value))
- return true;
- }
-
- return false;
+ return find_if(begin(), end(), bind2nd(ycpequal(), value)) != end();
}



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

< Previous Next >
This Thread
  • No further messages