fix: continued moving everything to orderedmaps plus cleaned up most the tests

This commit is contained in:
Tristan Cartledge
2023-12-01 17:37:07 +00:00
parent 0f3d0cb28f
commit a4ad09aab3
169 changed files with 3435 additions and 3764 deletions

View File

@@ -56,7 +56,6 @@ func (c *CallbackChanges) TotalBreakingChanges() int {
// CompareCallback will compare two Callback objects and return a pointer to CallbackChanges with all the things
// that have changed between them.
func CompareCallback(l, r *v3.Callback) *CallbackChanges {
cc := new(CallbackChanges)
var changes []*Change
@@ -66,12 +65,12 @@ func CompareCallback(l, r *v3.Callback) *CallbackChanges {
lValues := make(map[string]low.ValueReference[*v3.PathItem])
rValues := make(map[string]low.ValueReference[*v3.PathItem])
for pair := orderedmap.First(l.Expression.Value); pair != nil; pair = pair.Next() {
for pair := orderedmap.First(l.Expression); pair != nil; pair = pair.Next() {
lHashes[pair.Key().Value] = low.GenerateHashString(pair.Value().Value)
lValues[pair.Key().Value] = pair.Value()
}
for pair := orderedmap.First(r.Expression.Value); pair != nil; pair = pair.Next() {
for pair := orderedmap.First(r.Expression); pair != nil; pair = pair.Next() {
rHashes[pair.Key().Value] = low.GenerateHashString(pair.Value().Value)
rValues[pair.Key().Value] = pair.Value()
}
@@ -94,7 +93,7 @@ func CompareCallback(l, r *v3.Callback) *CallbackChanges {
expChanges[k] = ComparePathItems(lValues[k].Value, rValues[k].Value)
}
//check right path item hashes
// check right path item hashes
for k := range rHashes {
lhash := lHashes[k]
if lhash == "" {