Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove no-op pops. #3530

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions pkg/buildscript/unmarshal_buildexpression.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/logging"
"github.com/ActiveState/cli/internal/multilog"
"github.com/ActiveState/cli/internal/rtutils/ptr"
"github.com/ActiveState/cli/internal/sliceutils"
)
Expand Down Expand Up @@ -128,12 +127,6 @@ const (

func unmarshalAssignments(path []string, m map[string]interface{}) ([]*Assignment, error) {
path = append(path, ctxAssignments)
defer func() {
_, _, err := sliceutils.Pop(path)
if err != nil {
multilog.Error("Could not pop context: %v", err)
}
}()

assignments := []*Assignment{}
for key, valueInterface := range m {
Expand All @@ -160,12 +153,6 @@ func unmarshalAssignments(path []string, m map[string]interface{}) ([]*Assignmen

func unmarshalValue(path []string, valueInterface interface{}) (*Value, error) {
path = append(path, ctxValue)
defer func() {
_, _, err := sliceutils.Pop(path)
if err != nil {
multilog.Error("Could not pop context: %v", err)
}
}()

value := &Value{}

Expand Down Expand Up @@ -236,25 +223,13 @@ func unmarshalValue(path []string, valueInterface interface{}) (*Value, error) {

func isAp(path []string, value map[string]interface{}) bool {
path = append(path, ctxIsAp)
defer func() {
_, _, err := sliceutils.Pop(path)
if err != nil {
multilog.Error("Could not pop context: %v", err)
}
}()

_, hasIn := value[inKey]
return !hasIn || sliceutils.Contains(path, ctxAssignments)
}

func unmarshalFuncCall(path []string, m map[string]interface{}) (*FuncCall, error) {
path = append(path, ctxFuncCall)
defer func() {
_, _, err := sliceutils.Pop(path)
if err != nil {
multilog.Error("Could not pop context: %v", err)
}
}()

// m is a mapping of function name to arguments. There should only be one
// set of arguments. Since the arguments are key-value pairs, it should be
Expand Down Expand Up @@ -317,12 +292,6 @@ func unmarshalFuncCall(path []string, m map[string]interface{}) (*FuncCall, erro

func unmarshalIn(path []string, inValue interface{}) (*Value, error) {
path = append(path, ctxIn)
defer func() {
_, _, err := sliceutils.Pop(path)
if err != nil {
multilog.Error("Could not pop context: %v", err)
}
}()

in := &Value{}

Expand Down
Loading