summaryrefslogtreecommitdiff
path: root/lib/unicode_normalize/normalize.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicode_normalize/normalize.rb')
-rw-r--r--lib/unicode_normalize/normalize.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicode_normalize/normalize.rb b/lib/unicode_normalize/normalize.rb
index 22768f4c01..8bc8c6f607 100644
--- a/lib/unicode_normalize/normalize.rb
+++ b/lib/unicode_normalize/normalize.rb
@@ -14,15 +14,15 @@ module UnicodeNormalize
REGEXP_C = Regexp.compile(REGEXP_C_STRING, Regexp::EXTENDED)
REGEXP_K = Regexp.compile(REGEXP_K_STRING, Regexp::EXTENDED)
NF_HASH_D = Hash.new do |hash, key|
- hash.delete hash.first[0] if hash.length>MAX_HASH_LENGTH # prevent DoS attack
+ hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
hash[key] = nfd_one(key)
end
NF_HASH_C = Hash.new do |hash, key|
- hash.delete hash.first[0] if hash.length>MAX_HASH_LENGTH # prevent DoS attack
+ hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
hash[key] = nfc_one(key)
end
NF_HASH_K = Hash.new do |hash, key|
- hash.delete hash.first[0] if hash.length>MAX_HASH_LENGTH # prevent DoS attack
+ hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
hash[key] = nfkd_one(key)
end