Skip to content

Commit

Permalink
Remove scary assumptions; let’s not risk producing an inconsistent UC…
Browse files Browse the repository at this point in the history
…D. (#582)
  • Loading branch information
eggrobin authored Oct 24, 2023
1 parent 46a9d99 commit b4d62b7
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1395,29 +1395,17 @@ private static void writeEnumeratedValues(
} else if (defaultBidiValues != null) {
Bidi_Class_Values bidiValue = Bidi_Class_Values.forName(value);
if (defaultBidiValues.containsValue(bidiValue)) {
// We assume that unassigned code points that have this value
// according to the props data also have this value according to the defaults.
// Otherwise we would need to intersect defaultBidiValues.keySet(bidiValue)
// with the unassigned set before removing from s.
s.removeAll(unassigned);
s.removeAll(defaultBidiValues.keySet(bidiValue).retainAll(unassigned));
}
} else if (defaultEaValues != null) {
East_Asian_Width_Values eaValue = East_Asian_Width_Values.forName(value);
if (defaultEaValues.containsValue(eaValue)) {
// We assume that unassigned code points that have this value
// according to the props data also have this value according to the defaults.
// Otherwise we would need to intersect defaultEaValues.keySet(eaValue)
// with the unassigned set before removing from s.
s.removeAll(unassigned);
s.removeAll(defaultEaValues.keySet(eaValue).retainAll(unassigned));
}
} else if (defaultLbValues != null) {
Line_Break_Values lbValue = Line_Break_Values.forName(value);
if (defaultLbValues.containsValue(lbValue)) {
// We assume that unassigned code points that have this value
// according to the props data also have this value according to the defaults.
// Otherwise we would need to intersect defaultEaValues.keySet(eaValue)
// with the unassigned set before removing from s.
s.removeAll(unassigned);
s.removeAll(defaultLbValues.keySet(lbValue).retainAll(unassigned));
}
}

Expand Down

0 comments on commit b4d62b7

Please sign in to comment.