From b453e212f0ad2b27c556e8348a77828216b6e41d Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 11 Oct 2024 13:05:40 +0200 Subject: [PATCH] Prefer `Object.equal?` over unknown module `equal?` method This is totally nitpicky, but it's easier to assume `Object.equal?` is pristine, while for a random user defined module, it could have been changed. --- lib/zeitwerk/explicit_namespace.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zeitwerk/explicit_namespace.rb b/lib/zeitwerk/explicit_namespace.rb index 391e39a..c7e96dc 100644 --- a/lib/zeitwerk/explicit_namespace.rb +++ b/lib/zeitwerk/explicit_namespace.rb @@ -29,7 +29,7 @@ class << self # @sig (String) -> Zeitwerk::Loader? internal def loader_for(mod, cname) - cpath = mod.equal?(Object) ? cname.name : "#{real_mod_name(mod)}::#{cname}" + cpath = Object.equal?(mod) ? cname.name : "#{real_mod_name(mod)}::#{cname}" @cpaths.delete(cpath) end