From 6df5f314ac7809e2aedc22a961cf31c4e3f21d42 Mon Sep 17 00:00:00 2001 From: kazu Date: Tue, 25 Mar 2014 14:42:36 +0000 Subject: remove unnecessary unshift * ext/pathname/lib/pathname.rb (Pathname#join): remove unnecessary unshift. * test/pathname/test_pathname.rb (TestPathname#test_join): add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pathname/lib/pathname.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/pathname') diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 20c92e23dc..bbcb5e4e2a 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -384,7 +384,6 @@ class Pathname # #=> true # def join(*args) - args.unshift self result = args.pop result = Pathname.new(result) unless Pathname === result return result if result.absolute? @@ -393,7 +392,7 @@ class Pathname result = arg + result return result if result.absolute? } - result + self + result end # -- cgit v1.2.3