mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-14 15:28:36 +02:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user