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

URLTest的Select函数代码是否有逻辑错误? #1751

Closed
CodingMoeButa opened this issue May 10, 2024 · 1 comment
Closed

URLTest的Select函数代码是否有逻辑错误? #1751

CodingMoeButa opened this issue May 10, 2024 · 1 comment

Comments

@CodingMoeButa
Copy link

CodingMoeButa commented May 10, 2024

if minDelay == 0 || minDelay > history.Delay+g.tolerance || minDelay > history.Delay-g.tolerance && minTime.Before(history.Time) {

此处为何是minDelay > history.Delay-g.tolerance而不是minDelay < history.Delay-g.tolerance

如果写成minDelay > history.Delay-g.tolerance,跟minDelay > history.Delay+g.tolerance“或运算”在一起的minDelay > history.Delay+g.tolerance || minDelay > history.Delay-g.tolerance就等效于一个minDelay > history.Delay-g.tolerance,也就是这整行代码等效于:

if minDelay == 0 || minDelay > history.Delay-g.tolerance && minTime.Before(history.Time) {

确定不是写错了?

另外,能否根据代码详细解释一下URLTest选择出站节点的算法?

@dyhkwong
Copy link
Contributor

44277e5

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

2 participants