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 1b14e39 commit 9d719db
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions syntax/std_seq.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,29 +217,6 @@ func stdSeq() rel.Attr {
)
}

// Shared method for contains, hasPrefix and hasSuffix
func includingProcess(
strHandler,
arrayHandler,
bytesHandler func(...rel.Value) rel.Value,
args ...rel.Value) rel.Value {
sub, subject := args[0], args[1]
switch subject.(type) {
case rel.String:
return strHandler(args...)
case rel.Array:
return arrayHandler(args...)
case rel.Bytes:
return bytesHandler(args...)
case rel.GenericSet:
if emptySet, isSet := sub.(rel.GenericSet); isSet && !emptySet.IsTrue() {
return rel.NewBool(true)
}
}

return rel.NewBool(false)
}

func strJoin(args ...rel.Value) rel.Value {
joiner, subject := args[0], args[1]
strs := subject.(rel.Set)
Expand Down

0 comments on commit 9d719db

Please sign in to comment.