summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-26 14:39:16 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-26 14:39:16 +0000
commit422c8baeb9639cc51a9f7d458c521f9bd4d98969 (patch)
tree56d02bdece9016c24e0368c848628bfaa7375aa5 /lib/net
parentcae1d532f5969d794179f398a6c867d5f402c21c (diff)
* lib/net/ftp.rb (parse_pasv_port): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/ftp.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 4fc7fabee3..a92a792b35 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -963,8 +963,9 @@ module Net
private :parse_pasv_ipv6_host
def parse_pasv_port(s)
- high, low = s.split(/,/).map(&:to_i)
- return (high << 8) + low
+ return s.split(/,/).map(&:to_i).inject { |x, y|
+ (x << 8) + y
+ }
end
private :parse_pasv_port