chore: update to use iterators on orderedmaps

This commit is contained in:
Tristan Cartledge
2024-08-14 12:10:07 +01:00
committed by quobix
parent c3eb16d4e4
commit 161a41f73b
73 changed files with 690 additions and 550 deletions

View File

@@ -157,8 +157,8 @@ func (p *Paths) Build(ctx context.Context, _, root *yaml.Node, idx *index.SpecIn
// Hash will return a consistent SHA256 Hash of the PathItem object
func (p *Paths) Hash() [32]byte {
var f []string
for pair := orderedmap.First(orderedmap.SortAlpha(p.PathItems)); pair != nil; pair = pair.Next() {
f = append(f, low.GenerateHashString(pair.Value().Value))
for v := range orderedmap.SortAlpha(p.PathItems).ValuesFromOldest() {
f = append(f, low.GenerateHashString(v.Value))
}
f = append(f, low.HashExtensions(p.Extensions)...)
return sha256.Sum256([]byte(strings.Join(f, "|")))