diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-01-26 12:13:21 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-01-28 06:49:28 +0000 |
commit | 81702b4b873c0e2b4247095b3b9462bcf34166ff (patch) | |
tree | dbf32627c838a2d583ea5f8764b01995e12665aa /ext/digest/sha2 | |
parent | f475dc1cd219240b31a1958e6df00b8582a259f5 (diff) |
[ruby/digest] Prefer `rb_const_get` over `rb_path2class` for direct constants
https://github.com/ruby/digest/commit/e5d30394b3
Diffstat (limited to 'ext/digest/sha2')
-rw-r--r-- | ext/digest/sha2/sha2init.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c index 94cccf3feb..ec48f3d8e6 100644 --- a/ext/digest/sha2/sha2init.c +++ b/ext/digest/sha2/sha2init.c @@ -40,8 +40,11 @@ Init_sha2(void) FOREACH_BITLEN(DECLARE_ALGO_CLASS) +#if 0 + mDigest = rb_define_module("Digest"); /* let rdoc know */ +#endif mDigest = rb_digest_namespace(); - cDigest_Base = rb_path2class("Digest::Base"); + cDigest_Base = rb_const_get(mDigest, rb_intern_const("Base")); #define DEFINE_ALGO_CLASS(bitlen) \ cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \ |