mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
remove unnecessary conditions in lib/unicode_normalize.rb
Because the methods in lib/unicode_normalize.rb are overwritten by those in lib/unicode_normalize/normalize.rb as soon as one of them is called, the check for whether UnicodeNormalized is defined or not is no longer necessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8001dae820
commit
107f157289
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ class String
|
|||
# #=> Encoding::CompatibilityError raised
|
||||
#
|
||||
def unicode_normalize(form = :nfc)
|
||||
require 'unicode_normalize/normalize.rb' unless defined? UnicodeNormalize
|
||||
require 'unicode_normalize/normalize.rb'
|
||||
unicode_normalize form # no recursion, because redefined in unicode_normalize/normalize.rb
|
||||
end
|
||||
|
||||
|
@ -41,7 +41,7 @@ class String
|
|||
# normalization in place.
|
||||
#
|
||||
def unicode_normalize!(form = :nfc)
|
||||
require 'unicode_normalize/normalize.rb' unless defined? UnicodeNormalize
|
||||
require 'unicode_normalize/normalize.rb'
|
||||
unicode_normalize! form
|
||||
end
|
||||
|
||||
|
@ -63,7 +63,7 @@ class String
|
|||
# #=> Encoding::CompatibilityError raised
|
||||
#
|
||||
def unicode_normalized?(form = :nfc)
|
||||
require 'unicode_normalize/normalize.rb' unless defined? UnicodeNormalize
|
||||
require 'unicode_normalize/normalize.rb'
|
||||
unicode_normalized? form
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue