mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
go: fix hash-map equality
This commit is contained in:
parent
a95b2ee9fd
commit
6c75df55da
@ -295,7 +295,17 @@ func Equal_Q(a MalType, b MalType) bool {
|
||||
}
|
||||
return true
|
||||
case HashMap:
|
||||
return false
|
||||
am := a.(HashMap).Val
|
||||
bm := b.(HashMap).Val
|
||||
if len(am) != len(bm) {
|
||||
return false
|
||||
}
|
||||
for k, v := range am {
|
||||
if !Equal_Q(v, bm[k]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
default:
|
||||
return a == b
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user