summaryrefslogtreecommitdiff
path: root/lib/rubygems/text.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/text.rb')
-rw-r--r--lib/rubygems/text.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rubygems/text.rb b/lib/rubygems/text.rb
index d6b891380e..da0795b771 100644
--- a/lib/rubygems/text.rb
+++ b/lib/rubygems/text.rb
@@ -4,12 +4,11 @@
# A collection of text-wrangling methods
module Gem::Text
-
##
# Remove any non-printable characters and make the text suitable for
# printing.
def clean_text(text)
- text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".".freeze)
+ text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".")
end
def truncate_text(text, description, max_length = 100_000)
@@ -67,7 +66,7 @@ module Gem::Text
str1.each_codepoint.with_index(1) do |char1, i|
j = 0
while j < m
- cost = (char1 == str2_codepoints[j]) ? 0 : 1
+ cost = char1 == str2_codepoints[j] ? 0 : 1
x = min3(
d[j + 1] + 1, # insertion
i + 1, # deletion