zongaro 2002/12/10 10:48:50
Modified: java/src/org/apache/xml/dtm/ref/sax2dtm Tag: XSLTC_DTM
SAX2DTM.java
Log:
Changed code in endElement to avoid superfluous calls to Vector.setSize method
and to avoid unnecessary pops and pushes of m_contextIndexes stack.
Revision Changes Path
No revision
No revision
1.28.2.8 +5 -3
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Index: SAX2DTM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
retrieving revision 1.28.2.7
retrieving revision 1.28.2.8
diff -u -r1.28.2.7 -r1.28.2.8
--- SAX2DTM.java 26 Nov 2002 15:02:42 -0000 1.28.2.7
+++ SAX2DTM.java 10 Dec 2002 18:48:50 -0000 1.28.2.8
@@ -1964,11 +1964,13 @@
// If no one noticed, startPrefixMapping is a drag.
// Pop the context for the last child (the one pushed by startElement)
- m_prefixMappings.setSize(m_contextIndexes.pop());
+ m_contextIndexes.quickPop(1);
// Do it again for this one (the one pushed by the last endElement).
- m_prefixMappings.setSize(m_contextIndexes.pop());
- m_contextIndexes.push(m_prefixMappings.size()); // for the next element.
+ int topContextIndex = m_contextIndexes.peek();
+ if (topContextIndex != m_prefixMappings.size()) {
+ m_prefixMappings.setSize(topContextIndex);
+ }
int lastNode = m_previous;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]