mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Add ContentHash.areEqualForList
This commit is contained in:
parent
f3e9a05134
commit
b905d93b47
@ -1,4 +1,4 @@
|
||||
module Review.Cache.ContentHash exposing (ContentHash, areEqual, areEqualForMaybe, hash)
|
||||
module Review.Cache.ContentHash exposing (ContentHash, areEqual, areEqualForList, areEqualForMaybe, hash)
|
||||
|
||||
import Vendor.Murmur3 as Murmur3
|
||||
|
||||
@ -28,3 +28,18 @@ areEqualForMaybe a b =
|
||||
|
||||
_ ->
|
||||
False
|
||||
|
||||
|
||||
areEqualForList : List ContentHash -> List ContentHash -> Bool
|
||||
areEqualForList aList bList =
|
||||
case aList of
|
||||
[] ->
|
||||
List.isEmpty bList
|
||||
|
||||
a :: aTail ->
|
||||
case bList of
|
||||
[] ->
|
||||
False
|
||||
|
||||
b :: bTail ->
|
||||
areEqual a b && areEqualForList aTail bTail
|
||||
|
Loading…
Reference in New Issue
Block a user