Skip to content

Commit

Permalink
mruby-hash-ext: use NONE.equal?() for NONE comparison; ref #6262
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 10, 2024
1 parent 4d7ad48 commit dcee404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mrbgems/mruby-hash-ext/mrblib/hash.rb
Expand Up @@ -164,7 +164,7 @@ def fetch(key, none=NONE, &block)
unless self.key?(key)
if block
block.call(key)
elsif none != NONE
elsif !NONE.equal?(none)
none
else
raise KeyError, "Key not found: #{key.inspect}"
Expand Down

0 comments on commit dcee404

Please sign in to comment.