From 1fe604a67501d5f05694266d065833e3c150d79a Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 6 Sep 2021 05:19:50 +0900 Subject: [PATCH] [ruby/reline] Add comments about optimizing chars in ASCII range of UTF-8 https://github.com/ruby/reline/commit/3c13d93486 --- lib/reline/unicode.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reline/unicode.rb b/lib/reline/unicode.rb index d111a849c4..a0fe0741f4 100644 --- a/lib/reline/unicode.rb +++ b/lib/reline/unicode.rb @@ -101,9 +101,9 @@ class Reline::Unicode def self.get_mbchar_width(mbchar) ord = mbchar.ord - if (0x00 <= ord and ord <= 0x1F) + if (0x00 <= ord and ord <= 0x1F) # in EscapedPairs return 2 - elsif (0x20 <= ord and ord <= 0x7E) + elsif (0x20 <= ord and ord <= 0x7E) # printable ASCII chars return 1 end m = mbchar.encode(Encoding::UTF_8).match(MBCharWidthRE)