Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54428 - /trunk/core/libycp/src/YCPBuiltinList.cc
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 13:39:29 -0000
  • Message-id: <E1LKYd7-0005na-32@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 14:39:28 2009
New Revision: 54428

URL: http://svn.opensuse.org/viewcvs/yast?rev=54428&view=rev
Log:
- use const_iterator in loops

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=54428&r1=54427&r2=54428&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinList.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinList.cc Wed Jan 7 14:39:28 2009
@@ -72,10 +72,9 @@

SymbolEntryPtr s = symbol->asEntry()->entry();

- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- YCPValue element = list->value (i);
- s->setValue (element);
+ s->setValue(*it);

YCPValue v = expr->evaluate ();

@@ -93,7 +92,7 @@

if (v->asBoolean ()->value ())
{
- ret = element;
+ ret = *it;
break;
}
}
@@ -399,10 +398,9 @@

SymbolEntryPtr s = symbol->asEntry()->entry();

- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- YCPValue element = list->value (i);
- s->setValue (element);
+ s->setValue(*it);

YCPValue v = expr->evaluate ();

@@ -423,7 +421,7 @@
}
if (v->asBoolean ()->value ())
{
- ret->add (element);
+ ret->add(*it);
}
}

@@ -460,9 +458,9 @@
YCPList ret;
SymbolEntryPtr s = symbol->asEntry()->entry();

- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- s->setValue (list->value (i));
+ s->setValue(*it);

YCPValue v = expr->evaluate ();

@@ -517,9 +515,9 @@
YCPList curr_list;
YCPMap curr_map;

- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- key->setValue (list->value (i));
+ key->setValue(*it);

YCPValue curr_value = expr->evaluate ();

@@ -1045,9 +1043,9 @@
SymbolEntryPtr s = sym->asEntry()->entry();
YCPValue ret = YCPVoid();

- for (int i=0; i < list->size(); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- s->setValue (list->value (i));
+ s->setValue(*it);

ret = expr->evaluate ();
if (ret.isNull())

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

< Previous Next >
This Thread
  • No further messages