Skip to content

Commit f7e46f9

Browse files
committed
fix(unicode-table-generator): fix duplicated unique indices
unicode-table-generator panicked while populating distinct_indices because of duplicated indices. This was introduced by swapping the order of canonical_words.push(...) and canonical_words.len().
1 parent 0f35336 commit f7e46f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/unicode-table-generator/src/raw_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl Canonicalized {
341341
for &w in unique_words {
342342
unique_mapping.entry(w).or_insert_with(|| {
343343
canonical_words.push(w);
344-
UniqueMapping::Canonical(canonical_words.len())
344+
UniqueMapping::Canonical(canonical_words.len() - 1)
345345
});
346346
}
347347
assert_eq!(canonicalized_words.len() + canonical_words.len(), unique_words.len());

0 commit comments

Comments
 (0)