summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-08-21 13:29:26 +0200
committerNicholas Clark <nick@ccl4.org>2011-08-25 11:34:36 +0200
commit5810a9df535b520e92fdee246a94d22d00cd0aad (patch)
tree4b9268182995b2c80f37e6e6fca188cf5a783160 /regen
parenta3a88924926dbbb2266637650a9d6c86eb3d54a9 (diff)
downloadperl-5810a9df535b520e92fdee246a94d22d00cd0aad.tar.gz
In embed.pl, simplify the code that parses regen/opcodes.
As @embed is sorted later, the order that we add entries to it doesn't matter. Hence add them immediately, avoiding the need to iterate over the "seen" hash.
Diffstat (limited to 'regen')
-rwxr-xr-xregen/embed.pl6
1 files changed, 2 insertions, 4 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 5be37445e6..681c99cb07 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -92,12 +92,10 @@ open IN, 'regen/opcodes' or die $!;
next unless $_;
next if /^#/;
my (undef, undef, $check) = split /\t+/, $_;
- ++$syms{$check};
- }
+ next if $syms{$check}++;
- foreach (keys %syms) {
# These are all indirectly referenced by globals.c.
- push @embed, ['pR', 'OP *', $_, 'NN OP *o'];
+ push @embed, ['pR', 'OP *', $check, 'NN OP *o'];
}
}
close IN;