Merge pull request #4577 from byene0923/develop

improve code quality
This commit is contained in:
Ming Deng 2021-04-15 16:30:14 +08:00 committed by GitHub
commit 29fd8719a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,7 @@
- Feat: add token bucket ratelimit filter [4508](https://github.com/beego/beego/pull/4508) - Feat: add token bucket ratelimit filter [4508](https://github.com/beego/beego/pull/4508)
- Improve: Avoid ignoring mistakes that need attention [4548](https://github.com/beego/beego/pull/4548) - Improve: Avoid ignoring mistakes that need attention [4548](https://github.com/beego/beego/pull/4548)
- Integration: DeepSource [4560](https://github.com/beego/beego/pull/4560) - Integration: DeepSource [4560](https://github.com/beego/beego/pull/4560)
- Integration: Remove unnecessary function call [4577](https://github.com/beego/beego/pull/4577)

View File

@ -294,8 +294,8 @@ func (t *Tree) Match(pattern string, ctx *context.Context) (runObject interface{
func (t *Tree) match(treePattern string, pattern string, wildcardValues []string, ctx *context.Context) (runObject interface{}) { func (t *Tree) match(treePattern string, pattern string, wildcardValues []string, ctx *context.Context) (runObject interface{}) {
if len(pattern) > 0 { if len(pattern) > 0 {
i := 0 i, l := 0, len(pattern)
for ; i < len(pattern) && pattern[i] == '/'; i++ { for ; i < l && pattern[i] == '/'; i++ {
} }
pattern = pattern[i:] pattern = pattern[i:]
} }