perf: use ByteArray.hash directly
This commit is contained in:
parent
c60ccdc974
commit
47b4eae9a6
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue