Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 2 additions & 9 deletions internal/addrs/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package addrs

import (
"slices"
"strings"

"github.com/hashicorp/hcl/v2"
Expand Down Expand Up @@ -58,15 +59,7 @@ func (m Module) String() string {
}

func (m Module) Equal(other Module) bool {
if len(m) != len(other) {
return false
}
for i := range m {
if m[i] != other[i] {
return false
}
}
return true
return slices.Equal(m, other)
}

type moduleKey string
Expand Down
12 changes: 2 additions & 10 deletions internal/addrs/module_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package addrs

import (
"fmt"
"slices"
"strings"

"github.com/hashicorp/hcl/v2"
Expand Down Expand Up @@ -305,16 +306,7 @@ func (mk moduleInstanceKey) uniqueKeySigil() {}
// Equal returns true if the receiver and the given other value
// contains the exact same parts.
func (m ModuleInstance) Equal(o ModuleInstance) bool {
if len(m) != len(o) {
return false
}

for i := range m {
if m[i] != o[i] {
return false
}
}
return true
return slices.Equal(m, o)
}

// Less returns true if the receiver should sort before the given other value
Expand Down
Loading