perf: use ByteArray.hash directly

This commit is contained in:
Gabriel Ebner 2022-12-02 10:13:07 -08:00 committed by Mac
parent c60ccdc974
commit 47b4eae9a6

View file

@ -108,8 +108,8 @@ instance : ToString Hash := ⟨Hash.toString⟩
def ofString (str : String) :=
mix nil <| mk <| hash str -- same as Name.mkSimple
def ofByteArray (bytes : ByteArray) :=
bytes.foldl (init := nil) fun h b => mix h (mk <| hash b)
def ofByteArray (bytes : ByteArray) : Hash :=
⟨hash bytes⟩
end Hash