Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions lib/domain_name/punycode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,9 @@ def encode(string)

# Main encoding loop

while h < input.length
# All non-basic code points < n have been handled already. Find
# the next larger one

m = MAXINT
input.each { |cp|
m = cp if (n...m) === cp
}
input.reject { |cp| cp < INITIAL_N }.uniq.sort.each do |m|
# All non-basic code points < n have been handled already. Advance
# to the next larger one from the ordering computed above.

# Increase delta enough to advance the decoder's <n,i> state to
# <m,0>, but guard against overflow
Expand Down