Skip to content

Commit

Permalink
check boolean string length
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Jul 24, 2020
1 parent 206bedb commit 54d2556
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v5/pkg/walkers/semantics/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ func handleBooleanOp(n tsl.Node, eval EvalFunc) (bool, error) {

switch r.Func {
case tsl.StringOp:
right = len(r.Left.(string)) == 1 && r.Left.(string)[0] == 't' ||
len(r.Left.(string)) == 4 && r.Left.(string)[0] == 'T'
right = (len(r.Left.(string)) == 1 || len(r.Left.(string)) == 4) &&
(r.Left.(string)[0] == 't' || r.Left.(string)[0] == 'T')
case tsl.NumberOp:
right = r.Left.(float64) != 0
case tsl.BooleanOp:
Expand Down

0 comments on commit 54d2556

Please sign in to comment.