diff options
author | Mikko Ahlroth <mikko@ahlroth.fi> | 2023-10-15 14:28:42 +0300 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-10-17 12:33:52 +0100 |
commit | a63339014ba5ebd5ad50b34bea53fb39d105ec52 (patch) | |
tree | 4693a4fb7f42182437693428829f29e12725518b /src | |
parent | d0d942ba9fda93a9338483335628fdae82a6fbad (diff) | |
download | gleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.tar.gz gleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.zip |
Fix map equality checking when the amount of keys differs
Diffstat (limited to 'src')
-rw-r--r-- | src/persistent-hash-map.mjs | 2 |
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; |