Method: Cantor::AbsoluteSet#include?

Defined in:
lib/cantor/absolute_set.rb

#include?(element) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
90
91
92
93
# File 'lib/cantor/absolute_set.rb', line 87

def include?(element)
  if n = @universe.fetch(element, false)
    # Same as (@mask & (1 << n)).zero? but potentially eliminates
    # converting the intermediate computation to a Ruby value
    not @mask[n].zero?
  end
end