improve code quality

* fill empty block of code
This commit is contained in:
t29kida 2021-05-21 13:13:47 +09:00
parent a4ebc2066e
commit 819ec2164c
3 changed files with 7 additions and 3 deletions

View File

@ -49,6 +49,7 @@
## Fix Sonar
- [4624](https://github.com/beego/beego/pull/4624)
- [4608](https://github.com/beego/beego/pull/4608)
- [4473](https://github.com/beego/beego/pull/4473)
- [4474](https://github.com/beego/beego/pull/4474)

View File

@ -250,7 +250,8 @@ func (c *Controller) Bind(obj interface{}) error {
return c.BindJson(obj)
}
i, l := 0, len(ct[0])
for ; i < l && ct[0][i] != ';'; i++ {
for i < l && ct[0][i] != ';' {
i++
}
switch ct[0][0:i] {
case "application/json":

View File

@ -294,7 +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{}) {
if len(pattern) > 0 {
i, l := 0, len(pattern)
for ; i < l && pattern[i] == '/'; i++ {
for i < l && pattern[i] == '/' {
i++
}
pattern = pattern[i:]
}
@ -316,7 +317,8 @@ func (t *Tree) match(treePattern string, pattern string, wildcardValues []string
}
var seg string
i, l := 0, len(pattern)
for ; i < l && pattern[i] != '/'; i++ {
for i < l && pattern[i] != '/' {
i++
}
if i == 0 {
seg = pattern