Fix D&D extraction issues and retire the completed audit
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
const (
|
||||
Key = "dnd/spells"
|
||||
normalizationPolicy = "dnd.spells.normalize.v1"
|
||||
normalizationPolicy = "dnd.spells.normalize.v2"
|
||||
NormalizationPolicy = normalizationPolicy
|
||||
)
|
||||
|
||||
@@ -157,20 +157,15 @@ func cloneSpellCast(input dnd.SpellCast) dnd.SpellCast {
|
||||
}
|
||||
|
||||
func canonicalizeSourceRefs(order shared.SourceRefOrder, input []source.SourceRef) ([]source.SourceRef, bool, int) {
|
||||
canonical := order.Canonicalize(input)
|
||||
return canonical, !sourceRefsEqual(input, canonical), len(input) - len(canonical)
|
||||
}
|
||||
|
||||
func sourceRefsEqual(left, right []source.SourceRef) bool {
|
||||
if (left == nil) != (right == nil) || len(left) != len(right) {
|
||||
return false
|
||||
}
|
||||
for index := range left {
|
||||
if left[index] != right[index] {
|
||||
return false
|
||||
orderChanged := false
|
||||
for index := 1; index < len(input); index++ {
|
||||
if order.Less(input[index], input[index-1]) {
|
||||
orderChanged = true
|
||||
break
|
||||
}
|
||||
}
|
||||
return true
|
||||
canonical := order.Canonicalize(input)
|
||||
return canonical, orderChanged, len(input) - len(canonical)
|
||||
}
|
||||
|
||||
type duplicateGroup struct {
|
||||
|
||||
Reference in New Issue
Block a user