mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
improve tree analysis
This commit is contained in:
@@ -235,8 +235,11 @@ public class Tree {
|
|||||||
if (children == null)
|
if (children == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Tree p1 = null;
|
if (!this.contains(t1) || !this.contains(t2))
|
||||||
Tree p2 = null;
|
return null;
|
||||||
|
|
||||||
|
Tree p1 = this;
|
||||||
|
Tree p2 = this;
|
||||||
for (Tree c : children) {
|
for (Tree c : children) {
|
||||||
if (c.contains(t1))
|
if (c.contains(t1))
|
||||||
p1 = c;
|
p1 = c;
|
||||||
@@ -244,12 +247,6 @@ public class Tree {
|
|||||||
p2 = c;
|
p2 = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p1 == null || p2 == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (p1 == p2)
|
|
||||||
return p1;
|
|
||||||
|
|
||||||
if (p1 != p2)
|
if (p1 != p2)
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user