mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
chore: update to use iterators on orderedmaps
This commit is contained in:
committed by
quobix
parent
c3eb16d4e4
commit
161a41f73b
@@ -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, "|")))
|
||||
|
||||
Reference in New Issue
Block a user