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

optimize loop logic #497

Merged
merged 1 commit into from
Dec 21, 2024
Merged

optimize loop logic #497

merged 1 commit into from
Dec 21, 2024

Conversation

xxfttkx
Copy link
Contributor

@xxfttkx xxfttkx commented Dec 21, 2024

优化break逻辑。

为什么不用哈希表,数据太少没必要吗

@Predidit
Copy link
Owner

感谢你的工作,这看上去优化的性能并且没有引入其他问题

我有些没有理解哈希表在这里的意义,我们是要创建一个底层是哈希表的 Map<T, T> 吗,你准备怎么改进这里的数据结构

@Predidit Predidit merged commit 2c91fad into Predidit:main Dec 21, 2024
5 checks passed
@xxfttkx
Copy link
Contributor Author

xxfttkx commented Dec 21, 2024

通过 pluginsController.pluginHTTPList 创建规则仓库中 Map<name,version>的映射,然后遍历 pluginsController.pluginList 判断规则是否更新, 这样就不需要两个for循环嵌套

@Predidit
Copy link
Owner

可以那么做。但我觉得增加了复杂度

规则最多几十条,没有必要在这里进行这样的性能优化

@xxfttkx
Copy link
Contributor Author

xxfttkx commented Dec 21, 2024

ok,我也觉得现在这样代码量不多也挺好的

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

Successfully merging this pull request may close these issues.

2 participants