mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
Merge pull request #111 from dubek/fix-go-hash-equality
go: fix hash equality
This commit is contained in:
commit
3ac3435ee1
@ -295,7 +295,17 @@ func Equal_Q(a MalType, b MalType) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
case HashMap:
|
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:
|
default:
|
||||||
return a == b
|
return a == b
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user