----- Original Message -----
From: "Daniel Rall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>