Re: [xml] Tiny refactoring patch for xmlParseCharData



I found two extra refactorings of the same kind in xmlParseComment.

Use the attached diff instead of the previous one, as this one contains
both.
Index: parser.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/parser.c,v
retrieving revision 1.444
diff -u -p -r1.444 parser.c
--- parser.c    17 Nov 2005 07:25:52 -0000      1.444
+++ parser.c    4 Jan 2006 16:32:07 -0000
@@ -3455,12 +3455,10 @@ xmlParseCharData(xmlParserCtxtPtr ctxt, 
 get_more_space:
            while (*in == 0x20) in++;
            if (*in == 0xA) {
-               ctxt->input->line++; ctxt->input->col = 1;
-               in++;
-               while (*in == 0xA) {
+               do {
                    ctxt->input->line++; ctxt->input->col = 1;
                    in++;
-               }
+               } while (*in == 0xA);
                goto get_more_space;
            }
            if (*in == '<') {
@@ -3496,12 +3494,10 @@ get_more:
            }
            ctxt->input->col = ccol;
            if (*in == 0xA) {
-               ctxt->input->line++; ctxt->input->col = 1;
-               in++;
-               while (*in == 0xA) {
+               do {
                    ctxt->input->line++; ctxt->input->col = 1;
                    in++;
-               }
+               } while (*in == 0xA);
                goto get_more;
            }
            if (*in == ']') {
@@ -3866,12 +3862,10 @@ xmlParseComment(xmlParserCtxtPtr ctxt) {
     in = ctxt->input->cur;
     do {
        if (*in == 0xA) {
-           ctxt->input->line++; ctxt->input->col = 1;
-           in++;
-           while (*in == 0xA) {
+           do {
                ctxt->input->line++; ctxt->input->col = 1;
                in++;
-           }
+           } while (*in == 0xA);
        }
 get_more:
         ccol = ctxt->input->col;
@@ -3883,12 +3877,10 @@ get_more:
        }
        ctxt->input->col = ccol;
        if (*in == 0xA) {
-           ctxt->input->line++; ctxt->input->col = 1;
-           in++;
-           while (*in == 0xA) {
+           do {
                ctxt->input->line++; ctxt->input->col = 1;
                in++;
-           }
+           } while (*in == 0xA);
            goto get_more;
        }
        nbchar = in - ctxt->input->cur;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]