commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roxspr...@apache.org
Subject cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli2 HelpSetting.java
Date Sat, 27 Mar 2004 00:43:11 GMT
roxspring    2004/03/26 16:43:11

  Modified:    cli/src/java/org/apache/commons/cli2 Tag:
                        RESEARCH_CLI_2_ROXSPRING HelpSetting.java
  Log:
  Minor optimisation - name.hashCode() is now called 1722 times in the test suite rather than
20268!!
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.5   +4 -1      jakarta-commons/cli/src/java/org/apache/commons/cli2/Attic/HelpSetting.java
  
  Index: HelpSetting.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli2/Attic/HelpSetting.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- HelpSetting.java	8 Feb 2004 13:08:58 -0000	1.1.2.4
  +++ HelpSetting.java	27 Mar 2004 00:43:11 -0000	1.1.2.5
  @@ -53,15 +53,18 @@
           new HelpSetting("DISPLAY_PARENT_ARGUMENT");
       public static final HelpSetting DISPLAY_PARENT_CHILDREN =
           new HelpSetting("DISPLAY_PARENT_CHILDREN");
  +    
       private final String name;
  +    private final int hashCode;
   
       private HelpSetting(final String name) {
           this.name = name;
  +        this.hashCode = name.hashCode();
           all.add(this);
       }
   
       public int hashCode() {
  -        return name.hashCode();
  +        return hashCode;
       }
   
       public boolean equals(final Object that) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message