- valid.c: (a? , b? , c? , ... , z?) was storing/restauring
  state far too often, simple fix used to avoid it.
Daniel
diff --git a/ChangeLog b/ChangeLog
index cea024b..5d67c16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jun  9 18:39:03 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* valid.c: (a? , b? , c? , ... , z?) was storing/restauring
+	  state far too often, simple fix used to avoid it.
+
 Sat Jun  9 16:10:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 	* xinclude.c: Raphael Hertzog had a trouble with DTD nodes
diff --git a/valid.c b/valid.c
index 6caf544..41a5863 100644
--- a/valid.c
+++ b/valid.c
@@ -3417,6 +3417,19 @@
 	    CONT = CONT->c1;
 	    goto cont;
 	case XML_ELEMENT_CONTENT_SEQ:
+	    /*
+	     * Small optimization.
+	     */
+	    if ((CONT->c1->type == XML_ELEMENT_CONTENT_ELEMENT) &&
+		((CONT->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
+		 (CONT->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
+		if ((NODE == NULL) ||
+		    (!xmlStrEqual(NODE->name, CONT->c1->name))) {
+		    DEPTH++;
+		    CONT = CONT->c2;
+		    goto cont;
+		}
+	    }
 	    DEPTH++;
 	    CONT = CONT->c1;
 	    goto cont;