Skip to content

Commit ec9aa43

Browse files
committed
[GR-17457] Simplify code for File.identical?
PullRequest: truffleruby/3240
2 parents b01678d + b250992 commit ec9aa43

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/main/ruby/truffleruby/core/file.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,7 @@ def self.identical?(orig, copy)
732732

733733
return false if Primitive.nil?(st_o) || Primitive.nil?(st_c)
734734

735-
return false unless st_o.dev == st_c.dev
736-
return false unless st_o.ino == st_c.ino
737-
return false unless st_o.ftype == st_c.ftype
738-
return false unless POSIX.access(orig, Constants::R_OK)
739-
return false unless POSIX.access(copy, Constants::R_OK)
740-
741-
true
735+
st_o.dev == st_c.dev and st_o.ino == st_c.ino and st_o.ftype == st_c.ftype
742736
end
743737

744738
##

src/main/ruby/truffleruby/core/posix.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def self.attach_function_eagerly(native_name, argument_types, return_type,
171171
end
172172

173173
# Filesystem-related
174-
attach_function :access, [:string, :int], :int
175174
attach_function :chdir, [:string], :int
176175
attach_function :chmod, [:string, :mode_t], :int
177176
attach_function :chown, [:string, :uid_t, :gid_t], :int

0 commit comments

Comments
 (0)