Skip to content

Commit

Permalink
Simplify comparison with bool string (bfenetworks#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonShining authored and iyangsj committed Nov 28, 2019
1 parent 5281efa commit 6b5af22
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions bfe_basic/condition/parser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,5 @@ func (b *BasicLit) ToBool() bool {
return false
}

switch strings.ToUpper(b.Value) {
case "TRUE":
return true
case "FALSE":
return false
default:
return false
}
return strings.ToUpper(b.Value) == "TRUE"
}

0 comments on commit 6b5af22

Please sign in to comment.