mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00

A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT. This commit alone doesn't make a significant difference yet, but I thought this commit should be committed independently. This method override was discussed in [Misc #16961].
9 lines
175 B
Ruby
9 lines
175 B
Ruby
class Integer
|
|
# call-seq:
|
|
# int.zero? -> true or false
|
|
#
|
|
# Returns +true+ if +num+ has a zero value.
|
|
def zero?
|
|
Primitive.cexpr! 'int_zero_p(self);'
|
|
end
|
|
end
|