Skip to content

Commit

Permalink
chore: slice append replace loop
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
  • Loading branch information
testwill committed Jul 19, 2023
1 parent a5ad2b8 commit 1e85133
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pkg/texttemplate/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ func (n *NodeRoot) AsString() string {

func (n *NodeRoot) GetValues() []interface{} {
var result []interface{}
for _, item := range n.Items {
result = append(result, item)
}
result = append(result, n.Items...)
return result
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/yttlibrary/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ func (m AssertModule) oneNotNullCheck(keys starlark.Sequence) core.StarlarkFunc
var keysToCheck []starlark.Value

if keys == nil {
for _, key := range dict.Keys() {
keysToCheck = append(keysToCheck, key)
}
keysToCheck = append(keysToCheck, dict.Keys()...)
} else {
var key starlark.Value
keys := keys.Iterate()
Expand Down

0 comments on commit 1e85133

Please sign in to comment.