Skip to content

Commit a035e2f

Browse files
author
Markus Westerlind
committed
Explain the single character merge
1 parent fca5694 commit a035e2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

idna/src/make_uts46_mapping_table.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ def mergeable_key(r):
123123
unicode_str = group[0][3]
124124
optimized_ranges.append((first, last, mapping, unicode_str))
125125

126-
import sys
126+
# We can reduce the size of the character range table and the index table to about 1/4
127+
# by merging runs of single character ranges and using character offsets from the start
128+
# of that range to retrieve the correct `Mapping` value
127129
def merge_single_char_ranges(ranges):
128130
current = []
129131
for r in ranges:

0 commit comments

Comments
 (0)