Skip to content

Commit

Permalink
Process our own args (43% speedup)
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Jan 2, 2011
1 parent d2195b7 commit e153603
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tools/build/c2str.pl
Expand Up @@ -18,7 +18,6 @@ =head1 DESCRIPTION

use Fcntl qw( :DEFAULT :flock );
use Text::Balanced qw(extract_delimited);
use Getopt::Long ();
use IO::File ();

my $outfile = 'all_cstring.str';
Expand All @@ -33,17 +32,16 @@ =head1 DESCRIPTION

$ALL->seek(2, 0); # in case its been appended to while we waited for the lock

my ( $result, $do_all, $do_init, $file );
$result = Getopt::Long::GetOptions(
"all" => \$do_all,
"init" => \$do_init,
);
my ( $do_all, $do_init, $file );
$do_all = 1 if $ARGV[0] eq "--all";
$do_init = 1 if $ARGV[0] eq "--init";

$do_all and do {
read_all();
create_c_include();
exit;
};

$do_init and do {
close $ALL;
unlink $outfile;
Expand Down

1 comment on commit e153603

@leto
Copy link
Member

@leto leto commented on e153603 Jan 3, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Please sign in to comment.