xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mor...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/dom ReverseIterator.java
Date Tue, 14 Aug 2001 12:50:13 GMT
morten      01/08/14 05:50:13

  Modified:    java/src/org/apache/xalan/xsltc/dom ReverseIterator.java
  Log:
  A fix to allow reverse iterators to be reset (inside nested for-each loops).
  PR:		n/a
  Obtained from:	n/a
  Submitted by:	morten@apache.org
  Reviewed by:	morten@apache.org
  
  Revision  Changes    Path
  1.2       +4 -2      xml-xalan/java/src/org/apache/xalan/xsltc/dom/ReverseIterator.java
  
  Index: ReverseIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/ReverseIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReverseIterator.java	2001/04/17 18:52:35	1.1
  +++ ReverseIterator.java	2001/08/14 12:50:13	1.2
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: ReverseIterator.java,v 1.1 2001/04/17 18:52:35 sboag Exp $
  + * @(#)$Id: ReverseIterator.java,v 1.2 2001/08/14 12:50:13 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -72,6 +72,7 @@
       private int[] _data = null;
       private int _last = 0;
       private int _current = 0;
  +    private int _start = -1;
   
       public ReverseIterator(NodeIterator source) {
   	_source = source;
  @@ -82,7 +83,8 @@
       }
   	
       public NodeIterator setStartNode(int node) {
  -	if (_data == null) {
  +	if ((_data == null) || (node != _start)) {
  +	    _start = node;
   	    _source.setStartNode(node);
   	    _data = new int[INIT_DATA_SIZE];
   	    _last = 0;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message