]> git.wincent.com - wikitext.git/commitdiff
Use _Wikitext_pop_all_from_stack before returning output
authorWincent Colaiuta <win@wincent.com>
Fri, 8 May 2009 12:52:59 +0000 (14:52 +0200)
committerWincent Colaiuta <win@wincent.com>
Fri, 8 May 2009 12:52:59 +0000 (14:52 +0200)
Use the function instead of performing a manual for-loop.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c

index 828d2bc0e05b9cbf2cd432b2b6a1067fbd0b598e..998c4204ff90b65c46352e09aff746ca4b647fe7 100644 (file)
@@ -2558,8 +2558,7 @@ VALUE Wikitext_parser_parse(int argc, VALUE *argv, VALUE self)
 
                 // close any open scopes on hitting EOF
                 _Wikitext_rollback_failed_link(parser); // if any
-                for (i = 0, j = parser->scope->count; i < j; i++)
-                    _Wikitext_pop_from_stack(parser, Qnil);
+                _Wikitext_pop_all_from_stack(parser, Qnil);
                 goto return_output; // break not enough here (want to break out of outer while loop, not inner switch statement)
 
             default: