Skip to content

Commit 466e944

Browse files
committed
mktables: Fix Useless use of const in void context
The code was attempting to get a slice of an entire array excluding the 0th element. But it was using the wrong incantation. The array is the path to a file with each element being one directory. And it just happened to work because of the current layout of the directories. This commit moves this slice fetch so it is not done in the loop, adds another sanity check, and is generally clearer what is going on.
1 parent 12ed097 commit 466e944

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

charclass_invlists.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456712,7 +456712,7 @@ static const U8 WB_dfa_table[] = {
456712456712
* 4be1c18e7b121d951018065b453bb05083f624c8f905ce8be7c0f354c9097c95 lib/unicore/extracted/DLineBreak.txt
456713456713
* 786833e0a3f5ec0c0cd0940e4c15f730f3a92163f354ecd7dede28a70c0fa892 lib/unicore/extracted/DNumType.txt
456714456714
* 00b43cc5c9b86a834f82389c4537f103e652821387daa556f0bd220f6c23007e lib/unicore/extracted/DNumValues.txt
456715-
* 53e3072f38ef578e901c0f6d47e42d8b2d596fef60a4fce3a605c6c14be51faf lib/unicore/mktables
456715+
* 927f970f471272a402927086bc5f013b831e5ed063c453511f1696c404d06415 lib/unicore/mktables
456716456716
* 63f771c327e92574fbd77919586079c38f669058a5e6b67ccec385ef8fcde882 lib/unicore/version
456717456717
* 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl
456718456718
* c7ff8e0d207d3538c7feb4a1a152b159e5e902d20293b303569ea8323e84633e regen/mk_PL_charclass.pl

lib/unicore/mktables

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16072,9 +16072,18 @@ sub register_file_for_name($table, $directory_ref, $file) {
1607216072

1607316073
# All go in the same subdirectory of unicore, or the special
1607416074
# pseudo-directory '#'
16075-
if ($directory_ref->[0] !~ / ^ $matches_directory | \# $ /x) {
16075+
my $sub_directory;
16076+
if ($directory_ref->[0] eq '#') {
16077+
Carp::my_carp("Pseudo-directory '#' should be only directory "
16078+
. join('/', @{$directory_ref}, $file))
16079+
if $directory_ref->@* > 1;
16080+
$sub_directory = '#';
16081+
}
16082+
else {
1607616083
Carp::my_carp("Unexpected directory in "
16077-
. join('/', @{$directory_ref}, $file));
16084+
. join('/', @{$directory_ref}, $file))
16085+
if $directory_ref->[0] ne $matches_directory;
16086+
$sub_directory = join '/', $directory_ref->@[1 .. $#$directory_ref];
1607816087
}
1607916088

1608016089
# For this table and all its equivalents ...
@@ -16086,7 +16095,7 @@ sub register_file_for_name($table, $directory_ref, $file) {
1608616095
# No swash means don't do the rest of this.
1608716096
next if $table->isa('Map_Table') && $table->fate != $ORDINARY;
1608816097

16089-
my $sub_filename = join('/', $directory_ref->[1, -1], $file);
16098+
my $sub_filename = "$sub_directory/$file";
1609016099

1609116100
my $property = $table->property;
1609216101
my $property_name = ($property == $perl)

lib/unicore/uni_keywords.pl

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

regcharclass.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

regexp_constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
* 4be1c18e7b121d951018065b453bb05083f624c8f905ce8be7c0f354c9097c95 lib/unicore/extracted/DLineBreak.txt
8080
* 786833e0a3f5ec0c0cd0940e4c15f730f3a92163f354ecd7dede28a70c0fa892 lib/unicore/extracted/DNumType.txt
8181
* 00b43cc5c9b86a834f82389c4537f103e652821387daa556f0bd220f6c23007e lib/unicore/extracted/DNumValues.txt
82-
* 53e3072f38ef578e901c0f6d47e42d8b2d596fef60a4fce3a605c6c14be51faf lib/unicore/mktables
82+
* 927f970f471272a402927086bc5f013b831e5ed063c453511f1696c404d06415 lib/unicore/mktables
8383
* 63f771c327e92574fbd77919586079c38f669058a5e6b67ccec385ef8fcde882 lib/unicore/version
8484
* 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl
8585
* c7ff8e0d207d3538c7feb4a1a152b159e5e902d20293b303569ea8323e84633e regen/mk_PL_charclass.pl

uni_keywords.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)