curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: minor optimization
Date Tue, 03 May 2016 15:38:17 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-322 ae6cb4be4 -> ea0537036


minor optimization


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ea053703
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ea053703
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ea053703

Branch: refs/heads/CURATOR-322
Commit: ea05370366c271825740499f483f0f0d7c80ee3f
Parents: ae6cb4b
Author: randgalt <randgalt@apache.org>
Authored: Tue May 3 10:38:11 2016 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 3 10:38:11 2016 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/schema/SchemaSet.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/ea053703/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
b/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
index d33519a..6226f23 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/schema/SchemaSet.java
@@ -106,10 +106,9 @@ public class SchemaSet
      */
     public Schema getSchema(String path)
     {
-        Schema schema = null;
         if ( schemas.size() > 0 )
         {
-            schema = pathSchemas.get(path);
+            Schema schema = pathSchemas.get(path);
             if ( schema == null )
             {
                 try
@@ -121,10 +120,10 @@ public class SchemaSet
                     throw new RuntimeException(e);
                 }
             }
-        }
-        if ( schema != null )
-        {
-            return schema;
+            if ( schema != null )
+            {
+                return schema;
+            }
         }
         if ( useDefaultSchema )
         {


Mime
View raw message