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

[xml] Tiny refactoring patch for xmlParseCharData



Avoiding duplicated code.
Index: parser.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/parser.c,v
retrieving revision 1.444
diff -u -p -u -r1.444 parser.c
--- parser.c	17 Nov 2005 07:25:52 -0000	1.444
+++ parser.c	4 Jan 2006 16:13:31 -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 == ']') {


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