From ba252ec0c35b87eeb67697c62b3917050d17b49b Mon Sep 17 00:00:00 2001 From: James Lee Date: Thu, 9 Jan 2014 16:01:58 -0600 Subject: [PATCH] Use 'unless' instead of 'if not' --- lib/rex/socket.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rex/socket.rb b/lib/rex/socket.rb index f5a49b68a0..e68a0263a6 100644 --- a/lib/rex/socket.rb +++ b/lib/rex/socket.rb @@ -190,11 +190,11 @@ module Socket # Rubinius has a bug where gethostbyname returns dotted quads instead of # NBO, but that's what we want anyway, so just short-circuit here. if res[0] =~ MATCH_IPV4 || res[0] =~ MATCH_IPV6 - if !accept_ipv6 + unless accept_ipv6 res.reject!{ |ascii| ascii =~ MATCH_IPV6 } end else - if !accept_ipv6 + unless accept_ipv6 res.reject!{ |nbo| nbo.length != 4 } end res.map!{ |nbo| self.addr_ntoa(nbo) } @@ -593,7 +593,7 @@ module Socket # def self.ipv6_link_address(intf) r = source_address("FF02::1%#{intf}") - return if !(r and r =~ /^fe80/i) + return nil if r.nil? || r !~ /^fe80/i r end