-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
v3(enhancement): remove utils.Trim*
because stdlib has same performance in go1.19
#2030
Conversation
can you check my last comments from the old one ? |
utils.EqualFold
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.
can you update benchmarks on README.md
do you considering using https://github.com/stretchr/testify instead of current |
done |
I just keep the old tests and benchmark as bytes inputs |
@@ -1245,7 +1245,7 @@ func (c *DefaultCtx) WriteString(s string) (int, error) { | |||
// XHR returns a Boolean property, that is true, if the request's X-Requested-With header field is XMLHttpRequest, | |||
// indicating that the request was issued by a client library (such as jQuery). | |||
func (c *DefaultCtx) XHR() bool { | |||
return utils.EqualFoldBytes(utils.UnsafeBytes(c.Get(HeaderXRequestedWith)), []byte("xmlhttprequest")) | |||
return utils.EqualFold(c.Get(HeaderXRequestedWith), "xmlhttprequest") |
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.
why do we use EqualFoldBytes
instead of EqualFold
in the first place?
I saw the updated benchmark result, I think we can remove these go 1.19
1.18 , our version is a little bit faster.
|
I agree |
utils.Trim*
because stdlib has save performance now
utils.Trim*
because stdlib has save performance nowutils.Trim*
because stdlib has same performance now
utils.Trim*
because stdlib has same performance nowutils.Trim*
because stdlib has same performance in go1.19
This pr remove
Trim
,TrimRight
andTrimLeft
.Stdlib functions have save performance now.