You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2016/05/03 17:38:17 UTC

curator git commit: minor optimization

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 <ra...@apache.org>
Authored: Tue May 3 10:38:11 2016 -0500
Committer: randgalt <ra...@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 )
         {