Skip to content

Commit 263d63d

Browse files
bulk88Leont
authored andcommitted
cut ops from TAP::Object::new and TAP::Formatter::Base
new() went from 17.2 seconds (/1000000) exclusive time nytprof to 12.2 seconds after this commit.
1 parent a3dcf11 commit 263d63d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/TAP/Formatter/Base.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,7 @@ sub _summary_test_header {
419419
}
420420

421421
sub _output {
422-
my $self = shift;
423-
424-
print { $self->stdout } @_;
422+
print { shift->stdout } @_;
425423
}
426424

427425
sub _failure_output {

lib/TAP/Object.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ L</_initialize> method. Returns a new object.
5050
=cut
5151

5252
sub new {
53-
my $class = shift;
54-
my $self = bless {}, $class;
55-
return $self->_initialize(@_);
53+
return bless({}, shift)->_initialize(@_);
5654
}
5755

5856
=head2 Instance Methods

0 commit comments

Comments
 (0)