fix(library/init/data/persistenthashmap/basic): isUnaryNode
This commit is contained in:
parent
b146ed735a
commit
0a86911bd0
1 changed files with 3 additions and 2 deletions
|
|
@ -165,8 +165,9 @@ partial def isUnaryEntries (a : Array (Entry α β (Node α β))) : Nat → Opti
|
|||
def isUnaryNode : Node α β → Option (α × β)
|
||||
| (Node.entries entries) := isUnaryEntries entries 0 none
|
||||
| (Node.collision keys vals heq) :=
|
||||
if h : 0 < keys.size then
|
||||
some (keys.fget ⟨0, h⟩, vals.fget ⟨0, heq ▸ h⟩)
|
||||
if h : 1 = keys.size then
|
||||
have 0 < keys.size from h ▸ (Nat.zeroLtSucc _);
|
||||
some (keys.fget ⟨0, this⟩, vals.fget ⟨0, heq ▸ this⟩)
|
||||
else
|
||||
none
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue