BUGFIX: Hashing datastore to work out changes

Changed hashing implementation to work out if there are changes
in the data store
This commit is contained in:
Tim Beatham
2023-11-30 15:58:26 +00:00
parent b9ba836ae3
commit 3ef1b68ba5
5 changed files with 22 additions and 9 deletions

View File

@ -76,3 +76,13 @@ func Contains[V any](list []V, proposition func(V) bool) bool {
return false
}
func Reduce[A any, V any](start A, values []V, reduce func(A, V) A) A {
accum := start
for _, elem := range values {
accum = reduce(accum, elem)
}
return accum
}