# HG changeset patch # User tatsuki # Date 1429484962 -32400 # Node ID 19c719aba7462fad41037e06153656a5d9119905 # Parent 68e5def4e745f1ffb8caa55366570832c9dec4d4 change getLoop return value diff -r 68e5def4e745 -r 19c719aba746 src/main/java/fj/data/TreeMap.java --- a/src/main/java/fj/data/TreeMap.java Sat Mar 21 11:23:09 2015 +0900 +++ b/src/main/java/fj/data/TreeMap.java Mon Apr 20 08:09:22 2015 +0900 @@ -32,7 +32,6 @@ * @return an empty TreeMap with the given key order. */ public static TreeMap empty(final Ord keyOrd) { - System.out.println("4"); return new TreeMap(Set.empty(TreeMap.ord(keyOrd))); } @@ -52,10 +51,10 @@ // // // // System.out.println("aaaa"); // // return x.bind(P2.>__2()); - return getLoop(k); + return Option.some(getLoop(k)); } - public Option getLoop(final K k) { + public V getLoop(final K k) { Set> cur = tree; // Option op = Option.none(); while (!cur.isEmpty()) { @@ -71,11 +70,11 @@ else if (i < 0) cur = cur.r(); else - return Option.some(head._2()); + return head._2(); } - return Option.none(); + return null; // return Option.none(); } @@ -203,7 +202,7 @@ public F> get() { return new F>() { public Option f(final K k) { - return getLoop(k); + return get(k); } }; }