Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.2的for循环逻辑bug #56

Open
rym4n opened this issue Dec 22, 2022 · 5 comments
Open

v0.6.2的for循环逻辑bug #56

rym4n opened this issue Dec 22, 2022 · 5 comments

Comments

@rym4n
Copy link

rym4n commented Dec 22, 2022

如下图,一个简单的数组循环,循环输出hello,然后两个if分支进行判断

image

结果输出了 12 次hello xxx,非常奇怪

image

删掉一个分支之后就是符合预期的结果

image

@sanjinhub
Copy link
Member

两个 IF,会生成两个链路,所以会增加 1 倍,当成多进程的思路去开发你就理解了。

@rym4n
Copy link
Author

rym4n commented Jan 19, 2023

两个 IF,会生成两个链路,所以会增加 1 倍,当成多进程的思路去开发你就理解了。

可是却变成了原来的4倍

@sanjinhub
Copy link
Member

@rym4n 有剧本截图吗?

@rym4n
Copy link
Author

rym4n commented Jan 30, 2023

@sanjinhub 在上面的图二和图三

@i11us0ry
Copy link

如下图,一个简单的数组循环,循环输出hello,然后两个if分支进行判断

image

结果输出了 12 次hello xxx,非常奇怪

image

删掉一个分支之后就是符合预期的结果

image

看了下源码,在做for循环时paths = await W5Tree().get_paths(d=self.node_link_data, start=right, end=self.end_app)会返回链路,图一返回的是[for->hello->if1->end,for->hello->if2->end]所以会递归执行for,而图三则是[for->hello->if->end]所以只会执行一次for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants