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 #1275

Merged
merged 4 commits into from Apr 24, 2022
Merged

optimize #1275

merged 4 commits into from Apr 24, 2022

Conversation

tylitianrui
Copy link
Contributor

@tylitianrui tylitianrui commented Apr 21, 2022

optimize the logic of fast path. similar pr #1272

args.go Outdated
// fast path: src doesn't contain encoded chars
return append(dst, src...)
}

idx := min(idxPercent, idxPlus)
if idx > 0 {
Copy link
Collaborator

@erikdubbelboer erikdubbelboer Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one of them is -1 you can still start at the other. So I would change this block to be smarter without the min func.

Copy link
Contributor Author

@tylitianrui tylitianrui Apr 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, it would be better

args.go Show resolved Hide resolved
args.go Show resolved Hide resolved
@tylitianrui tylitianrui requested a review from erikdubbelboer Apr 24, 2022
@erikdubbelboer erikdubbelboer merged commit 9a0b4d0 into valyala:master Apr 24, 2022
14 checks passed
@erikdubbelboer
Copy link
Collaborator

erikdubbelboer commented Apr 24, 2022

Thanks!

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.

None yet

2 participants