|
@@ -968,19 +968,15 @@ Transition.prototype.setTrigger = function(trigger) {
|
|
|
Transition.prototype.optimize = function() {
|
|
|
// the least-common ancestor can be computed statically
|
|
|
var target = this.targets[0];
|
|
|
- if (target.ancestors.indexOf(this.source) >= 0) {
|
|
|
- this.lca = this.source
|
|
|
- } else {
|
|
|
- this.lca = this.source.my_parent;
|
|
|
- if (this.source.my_parent != target.my_parent) { // external
|
|
|
- for (let a of this.source.ancestors) {
|
|
|
- if (target.ancestors.indexOf(a) >= 0) {
|
|
|
- this.lca = a;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.lca = this.source.my_parent;
|
|
|
+ if (this.source.my_parent != target.my_parent) { // external
|
|
|
+ for (let a of this.source.ancestors) {
|
|
|
+ if (target.ancestors.indexOf(a) >= 0) {
|
|
|
+ this.lca = a;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// RuntimeClassBase
|