[svn:parrot] r47643 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Tue Jun 15 16:52:49 UTC 2010
Author: NotFound
Date: Tue Jun 15 16:52:49 2010
New Revision: 47643
URL: https://trac.parrot.org/parrot/changeset/47643
Log:
minor cleanup of StringIterator set_integer_native, no functional changes
Modified:
trunk/src/pmc/stringiterator.pmc
Modified: trunk/src/pmc/stringiterator.pmc
==============================================================================
--- trunk/src/pmc/stringiterator.pmc Tue Jun 15 16:47:12 2010 (r47642)
+++ trunk/src/pmc/stringiterator.pmc Tue Jun 15 16:52:49 2010 (r47643)
@@ -139,19 +139,21 @@
VTABLE void set_integer_native(INTVAL value) {
Parrot_StringIterator_attributes * const attrs =
PARROT_STRINGITERATOR(SELF);
- if (value == ITERATE_FROM_START) {
+ switch (value) {
+ case ITERATE_FROM_START:
attrs->reverse = 0;
attrs->pos = 0;
attrs->length = VTABLE_elements(INTERP, attrs->string);
- }
- else if (value == ITERATE_FROM_END) {
+ break;
+ case ITERATE_FROM_END:
attrs->reverse = 1;
attrs->pos = attrs->length
= VTABLE_elements(INTERP, attrs->string);
- }
- else
+ break;
+ default:
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Wrong direction for StringIterator");
+ }
}
/*
More information about the parrot-commits
mailing list