Skip to content

Commit aa4d4c6

Browse files
committed
Optimize Pathname#initialize to avoid extra __send__
1 parent f8e0cae commit aa4d4c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/pathname.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class Pathname
235235
# If +path+ contains a NUL character (<tt>\0</tt>), an ArgumentError is raised.
236236
#
237237
def initialize(path)
238-
path = path.__send__(TO_PATH) if path.respond_to? TO_PATH
238+
path = path.to_path if path.respond_to? :to_path
239239
@path = path.dup
240240

241241
if /\0/.match?(@path)

0 commit comments

Comments
 (0)