Skip to content

Commit

Permalink
#234 Updated code as review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzhang6222 committed May 25, 2020
1 parent 9d719db commit 8996b5c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions syntax/std_seq.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ func stdSeq() rel.Attr {
case rel.Bytes:
return rel.NewBool(strings.Contains(asString(subject), asString(sub)))
case rel.GenericSet:
if emptySet, isSet := sub.(rel.GenericSet); isSet && !emptySet.IsTrue() {
return rel.NewBool(true)
}
emptySet, isSet := sub.(rel.GenericSet)
return rel.NewBool(isSet && !emptySet.IsTrue())
}

return rel.NewBool(false)
Expand All @@ -91,9 +90,8 @@ func stdSeq() rel.Attr {
case rel.Bytes:
return rel.NewBool(strings.HasPrefix(asString(subject), asString(prefix)))
case rel.GenericSet:
if emptySet, isSet := prefix.(rel.GenericSet); isSet && !emptySet.IsTrue() {
return rel.NewBool(true)
}
emptySet, isSet := prefix.(rel.GenericSet)
return rel.NewBool(isSet && !emptySet.IsTrue())
}

return rel.NewBool(false)
Expand All @@ -108,9 +106,8 @@ func stdSeq() rel.Attr {
case rel.Bytes:
return rel.NewBool(strings.HasSuffix(asString(subject), asString(suffix)))
case rel.GenericSet:
if emptySet, isSet := suffix.(rel.GenericSet); isSet && !emptySet.IsTrue() {
return rel.NewBool(true)
}
emptySet, isSet := suffix.(rel.GenericSet)
return rel.NewBool(isSet && !emptySet.IsTrue())
}

return rel.NewBool(false)
Expand Down

0 comments on commit 8996b5c

Please sign in to comment.