@@ -7013,37 +7013,34 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
7013
7013
7014
7014
t_invlist = _new_invlist(1);
7015
7015
7016
+ /* Initialize to a single range */
7017
+ t_invlist = _add_range_to_invlist(t_invlist, 0, UV_MAX);
7018
+
7019
+ /* For the first pass, the lhs is partitioned such that the
7020
+ * number of UTF-8 bytes required to represent a code point in each
7021
+ * partition is the same as the number for any other code point in
7022
+ * that partion. We copy the pre-compiled partion. */
7023
+ len = C_ARRAY_LENGTH(PL_partition_by_byte_length);
7024
+ invlist_extend(t_invlist, len);
7025
+ t_array = invlist_array(t_invlist);
7026
+ Copy(PL_partition_by_byte_length, t_array, len, UV);
7027
+ invlist_set_len(t_invlist, len, *(get_invlist_offset_addr(t_invlist)));
7028
+ Newx(r_map, len + 1, UV);
7029
+
7016
7030
/* Parse the (potentially adjusted) input, creating the inversion map.
7017
7031
* This is done in two passes. The first pass is to determine if the
7018
7032
* transliteration can be done in place. The inversion map it creates
7019
7033
* could be used, but generally would be larger and slower to run than the
7020
7034
* output of the second pass, which starts with a more compact table and
7021
7035
* allows more ranges to be merged */
7022
7036
for (pass2 = 0; pass2 < 2; pass2++) {
7023
-
7024
- /* Initialize to a single range */
7025
- t_invlist = _add_range_to_invlist(t_invlist, 0, UV_MAX);
7026
-
7027
- /* In the second pass, we just have the single range */
7028
-
7029
7037
if (pass2) {
7030
- len = 1;
7031
- t_array = invlist_array(t_invlist);
7032
- }
7033
- else {
7038
+ /* Initialize to a single range */
7039
+ t_invlist = _add_range_to_invlist(t_invlist, 0, UV_MAX);
7034
7040
7035
- /* But in the first pass, the lhs is partitioned such that the
7036
- * number of UTF-8 bytes required to represent a code point in each
7037
- * partition is the same as the number for any other code point in
7038
- * that partion. We copy the pre-compiled partion. */
7039
- len = C_ARRAY_LENGTH(PL_partition_by_byte_length);
7040
- invlist_extend(t_invlist, len);
7041
+ /* In the second pass, we just have the single range */
7042
+ len = 1;
7041
7043
t_array = invlist_array(t_invlist);
7042
- Copy(PL_partition_by_byte_length, t_array, len, UV);
7043
- invlist_set_len(t_invlist,
7044
- len,
7045
- *(get_invlist_offset_addr(t_invlist)));
7046
- Newx(r_map, len + 1, UV);
7047
7044
}
7048
7045
7049
7046
/* And the mapping of each of the ranges is initialized. Initially,
0 commit comments