"Diethelm Guallar, Gonzalo" wrote:
>
> [Don't know if this is used at all...]
>
> In class BaseObject (src/java/org/apache/turbine/om/BaseObject.java)
> there is a method equals() defined as:
>
> public static boolean equals( String a, String b )
> {
> if ( ( a == null && b != null ) || ( a != null && b == null ) )
> return false;
> return ( a == null && b == null ) || a.equals(b);
> }
>
> This is pretty inefficient. Here is a quicker (and, IMHO, clearer)
> implementation:
>
> public static boolean equals( String a, String b )
> {
> if ( a == null ) {
> return ( b == null );
> } else if (b == null) {
> return false;
> } else {
> return a.equals(b);
> }
> }
I agree and have applied your patch. Thanks!
--
Daniel Rall <[EMAIL PROTECTED]>
http://collab.net/ | open source | do the right thing
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]