Closed petdance closed 5 years ago
In the main loop, if the line isn't a match, we do this:
else { chomp; # XXX Proper newline handling? print_line_if_context( $filename, $_, $., '-' ); }
If we're not doing context (the most common case), then the chomp is unnecessary and the print_line_if_context is unnecessary.
chomp
print_line_if_context
Let's look at inlining that code, since we're not going to be making any more functionality changes in ack2, and keep this in mind in ack3.
In my basic testing, it sped things up about 4%.
Can't inline this.
In the main loop, if the line isn't a match, we do this:
If we're not doing context (the most common case), then the
chomp
is unnecessary and theprint_line_if_context
is unnecessary.Let's look at inlining that code, since we're not going to be making any more functionality changes in ack2, and keep this in mind in ack3.