vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/zone_transfer.rb
# Compare two serials according to RFC 1982. Return 0 if equal,
# -1 if s1 is bigger, 1 if s1 is smaller.
Compare two serials according to RFC 1982. Return 0 if equal,
1 if s1 is bigger, 1 if s1 is smaller.
Compare two serials according to RFC 1982 . Return 0 if equal 1 if s1 is bigger 1 if s1 is smaller .
def compare_serial(s1, s2)
      if s1 == s2
        return 0
      end
      if s1 < s2 and (s2 - s1) < (2**31)
        return 1
      end
      if s1 > s2 and (s1 - s2) > (2**31)
        return 1
      end
      if s1 < s2 and (s2 - s1) > (2**31)
        return -1
      end
      if s1 > s2 and (s1 - s2) < (2**31)
        return -1
      end
      return 0
    end
def compare_serial ( s1 , s2 ) if s1 == s2 return 0 end if s1 < s2 and ( s2 - s1 ) < ( 2 ** 31 ) return 1 end if s1 > s2 and ( s1 - s2 ) > ( 2 ** 31 ) return 1 end if s1 < s2 and ( s2 - s1 ) > ( 2 ** 31 ) return - 1 end if s1 > s2 and ( s1 - s2 ) < ( 2 ** 31 ) return - 1 end return 0 end
Compare two serials according to RFC 1982.
Compare two serials according to RFC 1982 .
s1
<not_specific>
s2
<not_specific>