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

Sync route tree to httprouter latest code #2368

Merged
merged 15 commits into from May 10, 2020
Merged

Sync route tree to httprouter latest code #2368

merged 15 commits into from May 10, 2020

Conversation

appleboy
Copy link
Member

  1. Add *Params in context.
  2. move maxParams counts to engine

@appleboy appleboy added this to the 1.7 milestone May 10, 2020
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@codecov
Copy link

codecov bot commented May 10, 2020

Codecov Report

Merging #2368 into master will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2368      +/-   ##
==========================================
+ Coverage   98.48%   98.63%   +0.15%     
==========================================
  Files          41       41              
  Lines        2305     2349      +44     
==========================================
+ Hits         2270     2317      +47     
+ Misses         20       18       -2     
+ Partials       15       14       -1     
Impacted Files Coverage Δ
context.go 98.08% <100.00%> (+<0.01%) ⬆️
gin.go 99.15% <100.00%> (+0.01%) ⬆️
tree.go 100.00% <100.00%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f3d96c...e0c3f79. Read the comment docs.

gin.go Outdated
@@ -256,13 +258,20 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
assert1(len(handlers) > 0, "there must be at least one handler")

debugPrintRoute(method, path, handlers)
varsCount := uint16(0)
Copy link
Member

@thinkerou thinkerou May 10, 2020

Choose a reason for hiding this comment

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

this zero value local var is't reassign value.

Copy link
Member Author

Choose a reason for hiding this comment

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

@thinkerou done.

Copy link
Member Author

Choose a reason for hiding this comment

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

@thinkerou done.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
tree.go Outdated
if len(n.children) == 1 {
if n.handlers != nil {
return ciPath
} else if fixTrailingSlash && len(n.children) == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

if instead of else if

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Copy link
Member

@thinkerou thinkerou left a comment

Choose a reason for hiding this comment

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

lgtm

@thinkerou thinkerou merged commit d17270d into master May 10, 2020
@appleboy appleboy deleted the performance branch May 16, 2020 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants