xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmar...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/framework XMLAttrList.java
Date Fri, 20 Jul 2001 17:26:10 GMT
lmartin     01/07/20 10:26:10

  Modified:    java/src/org/apache/xerces/framework XMLAttrList.java
  Log:
  Performance patches related to array resizing - submitted by Henry Zongaro
  
  Revision  Changes    Path
  1.10      +8 -9      xml-xerces/java/src/org/apache/xerces/framework/XMLAttrList.java
  
  Index: XMLAttrList.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLAttrList.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLAttrList.java	2001/07/05 14:53:36	1.9
  +++ XMLAttrList.java	2001/07/20 17:26:10	1.10
  @@ -94,7 +94,7 @@
    * may be used to access the attribute list through the SAX <code>AttributeList</code>
    * interface.
    *
  - * @version $Id: XMLAttrList.java,v 1.9 2001/07/05 14:53:36 sandygao Exp $
  + * @version $Id: XMLAttrList.java,v 1.10 2001/07/20 17:26:10 lmartin Exp $
    */
   public final class XMLAttrList
       implements AttributeList {
  @@ -687,11 +687,8 @@
       //
   
       /* Expand our internal data structures as needed. */
  -    private boolean ensureCapacity(int chunk, int index) {
  -
  -        try {
  -            return fAttName[chunk][index] != 0;
  -        } catch (ArrayIndexOutOfBoundsException ex) {
  +    private void ensureCapacity(int chunk, int index) {
  +          if (chunk >= fAttPrefix.length) {
               int[][] newIntArray = new int[chunk * 2][];
               System.arraycopy(fAttPrefix, 0, newIntArray, 0, chunk);
               fAttPrefix = newIntArray;
  @@ -713,7 +710,9 @@
               byte[][] newByteArray = new byte[chunk * 2][];
               System.arraycopy(fAttFlags, 0, newByteArray, 0, chunk);
               fAttFlags = newByteArray;
  -        } catch (NullPointerException ex) {
  +        }
  +        else if (fAttPrefix[chunk] != null) {
  +            return;
           }
           fAttPrefix[chunk] = new int[CHUNK_SIZE];
           fAttLocalpart[chunk] = new int[CHUNK_SIZE];
  @@ -722,8 +721,8 @@
           fAttValue[chunk] = new int[CHUNK_SIZE];
           fAttType[chunk] = new int[CHUNK_SIZE];
           fAttFlags[chunk] = new byte[CHUNK_SIZE];
  -        return true;
  +        return;
   
  -    } // ensureCapacity(int,int):boolean
  +    } // ensureCapacity(int,int):void
   
   } // class XMLAttrList
  
  
  

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


Mime
View raw message