harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@pobox.com>
Subject Re: [classlib] Approval for String patch for HARMONY-719
Date Mon, 03 Jul 2006 16:12:23 GMT
Interesting - couldn't you promote this fix as a minor performance
improvement as well to knock out would would be a pointless instanceof
in the case of ""?

public boolean contentEquals(CharSequence cs) {

  if (cs == null) {
	throw new NPE;
  }

  if (cs.length() != count) {
        return false;
  }

  if (cs.length() == 0 && count == 0) {
        return true;  // since both are empty strings
  }

  if (cs instanceof StringBuffer) {
        return contentEquals(...);
  }
  else {
    return regionMatches(...);
  }
}


Nathan Beyer wrote:
> http://issues.apache.org/jira/browse/HARMONY-719
> 
>  
> 
> This issue identifies a valid bug in java.lang.String and good patch to fix
> it. Does anyone have any objections to applying this patch or any comments?
> 
>  
> 
> -Nathan
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message