ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: [PATCH] Project.java
Date Wed, 12 Jun 2002 23:57:33 GMT

----- Original Message -----
From: "Daniel Rall" <dlr@apache.org>
To: <ant-dev@jakarta.apache.org>
Sent: Wednesday, June 12, 2002 4:11 PM
Subject: [PATCH] Project.java


> A more concise implementation of getProperty(String).  No functional
> change.
>
> Index: Project.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
> retrieving revision 1.109
> diff -u -u -r1.109 Project.java
> --- Project.java 1 Jun 2002 12:26:37 -0000 1.109
> +++ Project.java 12 Jun 2002 23:09:32 -0000
> @@ -495,11 +495,7 @@
>       *         or if a <code>null</code> name is provided.
>       */
>      public String getProperty(String name) {
> -        if (name == null) {
> -          return null;
> -        }
> -        String property = (String) properties.get(name);
> -        return property;
> +        return (name == null ? null : (String) properties.get(name));
>      }

Does this have any speed benefits? ie, does it map down to a conditional
move CMOV opcode on x86 so you avoid a speculation/branch misprediction
penalty, or is it just a style thing?



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message