Skip to content

Commit

Permalink
improve code change according to review)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 10, 2014
1 parent d12baa8 commit e369a05
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ruby/yast/ops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ def initialize value, localized = false
# Only tricky part is Fixnum/Bignum, which is in fact same, so it has special handling in code
CLASS_ORDER = [ ::NilClass, ::FalseClass, ::TrueClass, ::Fixnum, ::Bignum, ::Float,
::String, Yast::Path, ::Symbol, ::Array, Yast::Term, ::Hash ]
NUMBERS_CLASS = [ ::Fixnum, ::Bignum, ::Float]
def <=> (second)
if @value.class == second.class
case @value
Expand All @@ -469,7 +468,7 @@ def <=> (second)
@value <=> second
end
else
if NUMBERS_CLASS.include?(@value.class) && NUMBERS_CLASS.include?(second.class)
if @value.is_a?(::Numeric) && second.is_a?(::Numeric)
return @value <=> second
end

Expand Down

0 comments on commit e369a05

Please sign in to comment.