aboutsummaryrefslogtreecommitdiff
path: root/src/persistent-hash-map.mjs
diff options
context:
space:
mode:
authorMikko Ahlroth <mikko@ahlroth.fi>2023-10-15 14:28:42 +0300
committerLouis Pilfold <louis@lpil.uk>2023-10-17 12:33:52 +0100
commita63339014ba5ebd5ad50b34bea53fb39d105ec52 (patch)
tree4693a4fb7f42182437693428829f29e12725518b /src/persistent-hash-map.mjs
parentd0d942ba9fda93a9338483335628fdae82a6fbad (diff)
downloadgleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.tar.gz
gleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.zip
Fix map equality checking when the amount of keys differs
Diffstat (limited to 'src/persistent-hash-map.mjs')
-rw-r--r--src/persistent-hash-map.mjs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/persistent-hash-map.mjs b/src/persistent-hash-map.mjs
index ff849d8..04aadd5 100644
--- a/src/persistent-hash-map.mjs
+++ b/src/persistent-hash-map.mjs
@@ -945,7 +945,7 @@ export default class PMap {
* @returns {boolean}
*/
equals(o) {
- if (!(o instanceof PMap)) {
+ if (!(o instanceof PMap) || this.size !== o.size) {
return false;
}
let equal = true;