i5ting / imove

INACTIVE: Move your mouse, generate code from flow chart
https://www.yuque.com/imove/docs/hvu0md
MIT License
3.75k stars 343 forks source link

fix(compile-code): run imove-branch node port condition only once #103

Closed csbun closed 3 years ago

csbun commented 3 years ago

In packages/compile-code/src/template/logic.ts#_getNextNodes(), imove-branch node conditions will be tested as much times as this.edges.length cuz the checking code were placed in the for (const edge of this.edges) loop. We can move them out the loop so it will run only once.

iloveyou11 commented 3 years ago

We've read your pull request. This problem does exist in our code, and it is wise to move the code of branch node to the outside of loop. Thank you very much for your commit.