From 24d2a42c227c3e1662d4ecf17b16149174d19ec0 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 5 Feb 2008 18:50:02 +0000 Subject: [PATCH] Get the key from config only once as it is costly git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@618741 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/kernel/AbstractBrokerFactory.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java index e63648138..28629f088 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java @@ -114,10 +114,8 @@ public abstract class AbstractBrokerFactory * @since 1.1.0 */ protected static Object toPoolKey(Map map) { - if (Configurations.getProperty("Id", map) != null) - return Configurations.getProperty("Id", map); - else - return map; + Object key = Configurations.getProperty("Id", map); + return ( key != null) ? key : map; } /**