[DOC] Fix typos in ObjectSpace::WeakMap docs

The value of variable key2 should be "bar". This way, when nil is assigned to val1 and garbage collection occurs, the output of m.keys will then be ["bar"].
This commit is contained in:
Andy Wong 2024-08-23 19:44:51 +08:00 committed by GitHub
parent 4dae4c6858
commit b51e1c07d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-05-14 12:41:59 +00:00
Merged: https://github.com/ruby/ruby/pull/11442

Merged-By: nobu <nobu@ruby-lang.org>

View File

@ -1019,7 +1019,7 @@ wkmap_inspect(VALUE self)
* val1 = Object.new
* m[key1] = val1
*
* key2 = "foo"
* key2 = "bar"
* val2 = Object.new
* m[key2] = val2
*