Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当
old.virtual和doc.virtual状态相同时(都为true或都为false),当前逻辑不会移除任何一个重复的参数文档,这会导致重复的文档仍然存在。你应该处理这种情况,例如,保留文件中先出现的文档(索引较低的那个)。此外,
removeByValue函数每次调用都会遍历bindDocs,导致此去重逻辑在最坏情况下的时间复杂度为 O(N^2)。对于有很多参数的函数,这可能会成为性能瓶颈。我建议修改逻辑以处理所有重复情况,并考虑一个更高效的 O(N) 实现来构建一个新的
bindDocs列表,而不是在迭代时从中移除元素。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同时为virtual或者同时都不是virtual,这是人为写出来的,可以自己避免,正常使用不会这么写,给一个函数加两个一模一样的virtual,或者在一个函数写两个一模一样的@PARAM注释。
最快的情况下O(N^2),通常是为每一个参数都加了虚拟注解,又重新写了每一个参数的真实注解,这种情况我认为也是不合理使用导致的,我们为某种规则的函数,根据规定用plugin定义了参数,说明是大部分都是正确的才会这样用,也就是大部分都不需要重写param