867 |
|
if (c != (pc = pk.getClass()) || |
868 |
|
!(k instanceof Comparable) || |
869 |
|
(dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) { |
870 |
< |
dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName()); |
871 |
< |
TreeNode r = null, s = null, pl, pr; |
872 |
< |
if (dir >= 0) { |
873 |
< |
if ((pl = p.left) != null && h <= pl.hash) |
874 |
< |
s = pl; |
870 |
> |
if ((dir = (c == pc) ? 0 : |
871 |
> |
c.getName().compareTo(pc.getName())) == 0) { |
872 |
> |
TreeNode r = null, pl, pr; // check both sides |
873 |
> |
if ((pr = p.right) != null && h >= pr.hash && |
874 |
> |
(r = getTreeNode(h, k, pr)) != null) |
875 |
> |
return r; |
876 |
> |
else if ((pl = p.left) != null && h <= pl.hash) |
877 |
> |
dir = -1; |
878 |
> |
else // nothing there |
879 |
> |
return null; |
880 |
|
} |
876 |
– |
else if ((pr = p.right) != null && h >= pr.hash) |
877 |
– |
s = pr; |
878 |
– |
if (s != null && (r = getTreeNode(h, k, s)) != null) |
879 |
– |
return r; |
881 |
|
} |
882 |
|
} |
883 |
|
else |
932 |
|
if (c != (pc = pk.getClass()) || |
933 |
|
!(k instanceof Comparable) || |
934 |
|
(dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) { |
935 |
< |
dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName()); |
936 |
< |
TreeNode r = null, s = null, pl, pr; |
937 |
< |
if (dir >= 0) { |
938 |
< |
if ((pl = p.left) != null && h <= pl.hash) |
939 |
< |
s = pl; |
935 |
> |
TreeNode s = null, r = null, pr; |
936 |
> |
if ((dir = (c == pc) ? 0 : |
937 |
> |
c.getName().compareTo(pc.getName())) == 0) { |
938 |
> |
if ((pr = p.right) != null && h >= pr.hash && |
939 |
> |
(r = getTreeNode(h, k, pr)) != null) |
940 |
> |
return r; |
941 |
> |
else // continue left |
942 |
> |
dir = -1; |
943 |
|
} |
944 |
|
else if ((pr = p.right) != null && h >= pr.hash) |
945 |
|
s = pr; |