diff options
author | Mike Dalessio <[email protected]> | 2024-12-02 17:07:57 -0500 |
---|---|---|
committer | git <[email protected]> | 2024-12-02 22:08:03 +0000 |
commit | af5c34fb0b6d06f9c78952bccc9879fa735b3857 (patch) | |
tree | 16d31a23ae14fd8dd4be6e24adaf5b268752f5fc /lib | |
parent | 4cce246d86d8ce16f13cfbbec465e0279d060f7f (diff) |
[ruby/rdoc] Prefer String#ord to #codepoints[0]
(https://github.com/ruby/rdoc/pull/1220)
https://github.com/ruby/rdoc/commit/09d7f35420
Co-authored-by: Nobuyoshi Nakada <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/code_object/method_attr.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rdoc/code_object/method_attr.rb b/lib/rdoc/code_object/method_attr.rb index d7fefa55d4..263780f7c7 100644 --- a/lib/rdoc/code_object/method_attr.rb +++ b/lib/rdoc/code_object/method_attr.rb @@ -114,8 +114,8 @@ class RDoc::MethodAttr < RDoc::CodeObject return unless other.respond_to?(:singleton) && other.respond_to?(:name) - [@singleton ? 0 : 1, name_codepoint_range, name] <=> - [other.singleton ? 0 : 1, other.name_codepoint_range, other.name] + [@singleton ? 0 : 1, name_ord_range, name] <=> + [other.singleton ? 0 : 1, other.name_ord_range, other.name] end def == other # :nodoc: @@ -415,8 +415,8 @@ class RDoc::MethodAttr < RDoc::CodeObject end end - def name_codepoint_range # :nodoc: - case name.codepoints[0] + def name_ord_range # :nodoc: + case name.ord when 0..64 # anything below "A" 1 when 91..96 # the symbols between "Z" and "a" |