← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:11 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic.pm
StatementsExecuted 180470 statements in 364ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
302411639ms7.77sPerl::Critic::::_critiquePerl::Critic::_critique
1441122.6ms32.4sPerl::Critic::::critiquePerl::Critic::critique
1441116.9ms14.9sPerl::Critic::::_gather_violationsPerl::Critic::_gather_violations
1113.15ms1.33sPerl::Critic::::BEGIN@24Perl::Critic::BEGIN@24
1112.27ms44.2msPerl::Critic::::BEGIN@26Perl::Critic::BEGIN@26
144111.74ms4.52msPerl::Critic::::_futz_with_policy_orderPerl::Critic::_futz_with_policy_order
145221.33ms2.12msPerl::Critic::::policiesPerl::Critic::policies
578521.21ms1.21msPerl::Critic::::configPerl::Critic::config
111917µs1.41msPerl::Critic::::BEGIN@27Perl::Critic::BEGIN@27
14411419µs419µsPerl::Critic::::statisticsPerl::Critic::statistics
111214µs966µsPerl::Critic::::BEGIN@23Perl::Critic::BEGIN@23
11122µs426msPerl::Critic::::newPerl::Critic::new
11117µs17µsPerl::Critic::::BEGIN@10Perl::Critic::BEGIN@10
11114µs2.71msPerl::Critic::::BEGIN@20Perl::Critic::BEGIN@20
11110µs33µsPerl::Critic::::BEGIN@21Perl::Critic::BEGIN@21
1119µs9µsPerl::Critic::::BEGIN@25Perl::Critic::BEGIN@25
1118µs316µsPerl::Critic::::BEGIN@28Perl::Critic::BEGIN@28
1118µs13µsPerl::Critic::::BEGIN@12Perl::Critic::BEGIN@12
1118µs28µsPerl::Critic::::BEGIN@15Perl::Critic::BEGIN@15
1118µs20µsPerl::Critic::::BEGIN@11Perl::Critic::BEGIN@11
1118µs382µsPerl::Critic::::BEGIN@14Perl::Critic::BEGIN@14
1117µs16µsPerl::Critic::::BEGIN@17Perl::Critic::BEGIN@17
1114µs4µsPerl::Critic::::BEGIN@19Perl::Critic::BEGIN@19
0000s0sPerl::Critic::::__ANON__[:210]Perl::Critic::__ANON__[:210]
0000s0sPerl::Critic::::add_policyPerl::Critic::add_policy
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8package Perl::Critic;
9
10240µs117µs
# spent 17µs within Perl::Critic::BEGIN@10 which was called: # once (17µs+0s) by Perl::Critic::Command::_critique at line 10
use 5.006001;
# spent 17µs making 1 call to Perl::Critic::BEGIN@10
11224µs233µs
# spent 20µs (8+12) within Perl::Critic::BEGIN@11 which was called: # once (8µs+12µs) by Perl::Critic::Command::_critique at line 11
use strict;
# spent 20µs making 1 call to Perl::Critic::BEGIN@11 # spent 12µs making 1 call to strict::import
12222µs218µs
# spent 13µs (8+5) within Perl::Critic::BEGIN@12 which was called: # once (8µs+5µs) by Perl::Critic::Command::_critique at line 12
use warnings;
# spent 13µs making 1 call to Perl::Critic::BEGIN@12 # spent 5µs making 1 call to warnings::import
13
14223µs2757µs
# spent 382µs (8+375) within Perl::Critic::BEGIN@14 which was called: # once (8µs+375µs) by Perl::Critic::Command::_critique at line 14
use English qw(-no_match_vars);
# spent 382µs making 1 call to Perl::Critic::BEGIN@14 # spent 375µs making 1 call to English::import
15222µs249µs
# spent 28µs (8+20) within Perl::Critic::BEGIN@15 which was called: # once (8µs+20µs) by Perl::Critic::Command::_critique at line 15
use Readonly;
# spent 28µs making 1 call to Perl::Critic::BEGIN@15 # spent 20µs making 1 call to Exporter::import
16
17220µs225µs
# spent 16µs (7+9) within Perl::Critic::BEGIN@17 which was called: # once (7µs+9µs) by Perl::Critic::Command::_critique at line 17
use Exporter 'import';
# spent 16µs making 1 call to Perl::Critic::BEGIN@17 # spent 9µs making 1 call to Exporter::import
18
19220µs14µs
# spent 4µs within Perl::Critic::BEGIN@19 which was called: # once (4µs+0s) by Perl::Critic::Command::_critique at line 19
use File::Spec;
# spent 4µs making 1 call to Perl::Critic::BEGIN@19
20233µs25.40ms
# spent 2.71ms (14µs+2.69) within Perl::Critic::BEGIN@20 which was called: # once (14µs+2.69ms) by Perl::Critic::Command::_critique at line 20
use List::MoreUtils qw< firstidx >;
# spent 2.71ms making 1 call to Perl::Critic::BEGIN@20 # spent 2.69ms making 1 call to Exporter::Tiny::import
21224µs256µs
# spent 33µs (10+23) within Perl::Critic::BEGIN@21 which was called: # once (10µs+23µs) by Perl::Critic::Command::_critique at line 21
use Scalar::Util qw< blessed >;
# spent 33µs making 1 call to Perl::Critic::BEGIN@21 # spent 23µs making 1 call to Exporter::import
22
23298µs2980µs
# spent 966µs (214+752) within Perl::Critic::BEGIN@23 which was called: # once (214µs+752µs) by Perl::Critic::Command::_critique at line 23
use Perl::Critic::Exception::Configuration::Generic;
# spent 966µs making 1 call to Perl::Critic::BEGIN@23 # spent 14µs making 1 call to Exporter::import
24290µs11.33s
# spent 1.33s (3.15ms+1.33) within Perl::Critic::BEGIN@24 which was called: # once (3.15ms+1.33s) by Perl::Critic::Command::_critique at line 24
use Perl::Critic::Config;
# spent 1.33s making 1 call to Perl::Critic::BEGIN@24
25223µs19µs
# spent 9µs within Perl::Critic::BEGIN@25 which was called: # once (9µs+0s) by Perl::Critic::Command::_critique at line 25
use Perl::Critic::Violation;
# spent 9µs making 1 call to Perl::Critic::BEGIN@25
262110µs144.2ms
# spent 44.2ms (2.27+41.9) within Perl::Critic::BEGIN@26 which was called: # once (2.27ms+41.9ms) by Perl::Critic::Command::_critique at line 26
use Perl::Critic::Document;
# spent 44.2ms making 1 call to Perl::Critic::BEGIN@26
272101µs11.41ms
# spent 1.41ms (917µs+489µs) within Perl::Critic::BEGIN@27 which was called: # once (917µs+489µs) by Perl::Critic::Command::_critique at line 27
use Perl::Critic::Statistics;
# spent 1.41ms making 1 call to Perl::Critic::BEGIN@27
282612µs2624µs
# spent 316µs (8+308) within Perl::Critic::BEGIN@28 which was called: # once (8µs+308µs) by Perl::Critic::Command::_critique at line 28
use Perl::Critic::Utils qw< :characters hashify shebang_line >;
# spent 316µs making 1 call to Perl::Critic::BEGIN@28 # spent 308µs making 1 call to Exporter::import
29
30#-----------------------------------------------------------------------------
31
321700nsour $VERSION = '1.121';
33
3413µs137µsReadonly::Array our @EXPORT_OK => qw(critique);
# spent 37µs making 1 call to Readonly::Array
35
36#=============================================================================
37# PUBLIC methods
38
39
# spent 426ms (22µs+426) within Perl::Critic::new which was called: # once (22µs+426ms) by Perl::Critic::Command::_critique at line 238 of Perl/Critic/Command.pm
sub new {
4011µs my ( $class, %args ) = @_;
411800ns my $self = bless {}, $class;
4217µs1426ms $self->{_config} = $args{-config} || Perl::Critic::Config->new( %args );
# spent 426ms making 1 call to Perl::Critic::Config::new
4316µs117µs $self->{_stats} = Perl::Critic::Statistics->new();
# spent 17µs making 1 call to Perl::Critic::Statistics::new
4415µs return $self;
45}
46
47#-----------------------------------------------------------------------------
48
49
# spent 1.21ms within Perl::Critic::config which was called 578 times, avg 2µs/call: # 145 times (364µs+0s) by Perl::Critic::policies at line 68, avg 3µs/call # 144 times (366µs+0s) by Perl::Critic::critique at line 103, avg 3µs/call # 144 times (315µs+0s) by Perl::Critic::_gather_violations at line 133, avg 2µs/call # 144 times (167µs+0s) by Perl::Critic::_gather_violations at line 128, avg 1µs/call # once (1µs+0s) by Perl::Critic::Command::_critique at line 241 of Perl/Critic/Command.pm
sub config {
50578192µs my $self = shift;
515781.69ms return $self->{_config};
52}
53
54#-----------------------------------------------------------------------------
55
56sub add_policy {
57 my ( $self, @args ) = @_;
58 #Delegate to Perl::Critic::Config
59 return $self->config()->add_policy( @args );
60}
61
62#-----------------------------------------------------------------------------
63
64
# spent 2.12ms (1.33+794µs) within Perl::Critic::policies which was called 145 times, avg 15µs/call: # 144 times (1.32ms+789µs) by Perl::Critic::critique at line 112, avg 15µs/call # once (10µs+5µs) by Perl::Critic::Command::_critique at line 239 of Perl/Critic/Command.pm
sub policies {
6514546µs my $self = shift;
66
67 #Delegate to Perl::Critic::Config
681451.06ms290794µs return $self->config()->policies();
# spent 430µs making 145 calls to Perl::Critic::Config::policies, avg 3µs/call # spent 364µs making 145 calls to Perl::Critic::config, avg 3µs/call
69}
70
71#-----------------------------------------------------------------------------
72
73
# spent 419µs within Perl::Critic::statistics which was called 144 times, avg 3µs/call: # 144 times (419µs+0s) by Perl::Critic::_gather_violations at line 138, avg 3µs/call
sub statistics {
7414476µs my $self = shift;
75144425µs return $self->{_stats};
76}
77
78#-----------------------------------------------------------------------------
79
80
# spent 32.4s (22.6ms+32.4) within Perl::Critic::critique which was called 144 times, avg 225ms/call: # 144 times (22.6ms+32.4s) by Perl::Critic::Command::_critique at line 249 of Perl/Critic/Command.pm, avg 225ms/call
sub critique { ## no critic (ArgUnpacking)
81
82 #-------------------------------------------------------------------
83 # This subroutine can be called as an object method or as a static
84 # function. In the latter case, the first argument can be a
85 # hashref of configuration parameters that shall be used to create
86 # an object behind the scenes. Note that this object does not
87 # persist. In other words, it is not a singleton. Here are some
88 # of the ways this subroutine might get called:
89 #
90 # #Object style...
91 # $critic->critique( $code );
92 #
93 # #Functional style...
94 # critique( $code );
95 # critique( {}, $code );
96 # critique( {-foo => bar}, $code );
97 #------------------------------------------------------------------
98
99144226µs my ( $self, $source_code ) = @_ >= 2 ? @_ : ( {}, $_[0] );
100144180µs $self = ref $self eq 'HASH' ? __PACKAGE__->new(%{ $self }) : $self;
10114436µs return if not defined $source_code; # If no code, then nothing to do.
102
103144344µs144366µs my $config = $self->config();
# spent 366µs making 144 calls to Perl::Critic::config, avg 3µs/call
1041442.10ms43216.5s my $doc =
# spent 16.5s making 144 calls to Perl::Critic::Document::new, avg 115ms/call # spent 549µs making 144 calls to Perl::Critic::Config::program_extensions_as_regexes, avg 4µs/call # spent 212µs making 144 calls to Scalar::Util::blessed, avg 1µs/call
105 blessed($source_code) && $source_code->isa('Perl::Critic::Document')
106 ? $source_code
107 : Perl::Critic::Document->new(
108 '-source' => $source_code,
109 '-program-extensions' => [$config->program_extensions_as_regexes()],
110 );
111
112144417µs1442.10ms if ( 0 == $self->policies() ) {
# spent 2.10ms making 144 calls to Perl::Critic::policies, avg 15µs/call
113 Perl::Critic::Exception::Configuration::Generic->throw(
114 message => 'There are no enabled policies.',
115 )
116 }
117
11814416.1ms14414.9s return $self->_gather_violations($doc);
# spent 14.9s making 144 calls to Perl::Critic::_gather_violations, avg 103ms/call
119}
120
121#=============================================================================
122# PRIVATE methods
123
124
# spent 14.9s (16.9ms+14.9) within Perl::Critic::_gather_violations which was called 144 times, avg 103ms/call: # 144 times (16.9ms+14.9s) by Perl::Critic::critique at line 118, avg 103ms/call
sub _gather_violations {
12514462µs my ($self, $doc) = @_;
126
127 # Disable exempt code lines, if desired
1281443.68ms4321.78s if ( not $self->config->force() ) {
# spent 1.78s making 144 calls to Perl::Critic::Document::process_annotations, avg 12.4ms/call # spent 342µs making 144 calls to Perl::Critic::Config::force, avg 2µs/call # spent 167µs making 144 calls to Perl::Critic::config, avg 1µs/call
129 $doc->process_annotations();
130 }
131
132 # Evaluate each policy
133144796µs288957µs my @policies = $self->config->policies();
# spent 643µs making 144 calls to Perl::Critic::Config::policies, avg 4µs/call # spent 315µs making 144 calls to Perl::Critic::config, avg 2µs/call
134144482µs1444.52ms my @ordered_policies = _futz_with_policy_order(@policies);
# spent 4.52ms making 144 calls to Perl::Critic::_futz_with_policy_order, avg 31µs/call
13531684.75ms30247.77s my @violations = map { _critique($_, $doc) } @ordered_policies;
# spent 7.77s making 3024 calls to Perl::Critic::_critique, avg 2.57ms/call
136
137 # Accumulate statistics
138144773µs2885.32s $self->statistics->accumulate( $doc, \@violations );
# spent 5.32s making 144 calls to Perl::Critic::Statistics::accumulate, avg 36.9ms/call # spent 419µs making 144 calls to Perl::Critic::statistics, avg 3µs/call
139
140 # If requested, rank violations by their severity and return the top N.
14114472µs if ( @violations && (my $top = $self->config->top()) ) {
142 my $limit = @violations < $top ? $#violations : $top-1;
143 @violations = Perl::Critic::Violation::sort_by_severity(@violations);
144 @violations = ( reverse @violations )[ 0 .. $limit ]; #Slicing...
145 }
146
147 # Always return violations sorted by location
1481441.88ms1441.07ms return Perl::Critic::Violation->sort_by_location(@violations);
# spent 1.07ms making 144 calls to Perl::Critic::Violation::sort_by_location, avg 7µs/call
149}
150
151#=============================================================================
152# PRIVATE functions
153
154
# spent 7.77s (639ms+7.14) within Perl::Critic::_critique which was called 3024 times, avg 2.57ms/call: # 3024 times (639ms+7.14s) by Perl::Critic::_gather_violations at line 135, avg 2.57ms/call
sub _critique {
1553024948µs my ($policy, $doc) = @_;
156
157302411.1ms57601.45s return if not $policy->prepare_to_scan_document($doc);
# spent 1.43s making 144 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::prepare_to_scan_document, avg 9.92ms/call # spent 16.4ms making 2736 calls to Perl::Critic::Policy::prepare_to_scan_document, avg 6µs/call # spent 4.22ms making 2736 calls to Readonly::Scalar::FETCH, avg 2µs/call # spent 1.12ms making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::prepare_to_scan_document, avg 8µs/call
158
15930244.79ms302420.7ms my $maximum_violations = $policy->get_maximum_violations_per_document();
# spent 20.7ms making 3024 calls to Perl::Critic::Policy::get_maximum_violations_per_document, avg 7µs/call
1603024500µs return if defined $maximum_violations && $maximum_violations == 0;
161
1623024817µs my @violations = ();
163
164 TYPE:
16530247.33ms30245.99ms for my $type ( $policy->applies_to() ) {
# spent 330µs making 144 calls to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::applies_to, avg 2µs/call # spent 320µs making 144 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::applies_to, avg 2µs/call # spent 309µs making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::applies_to, avg 2µs/call # spent 305µs making 144 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::applies_to, avg 2µs/call # spent 303µs making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::applies_to, avg 2µs/call # spent 298µs making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::applies_to, avg 2µs/call # spent 291µs making 144 calls to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::applies_to, avg 2µs/call # spent 290µs making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::applies_to, avg 2µs/call # spent 284µs making 144 calls to Perl::Critic::Policy::ValuesAndExpressions::ProhibitLeadingZeros::applies_to, avg 2µs/call # spent 283µs making 144 calls to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::applies_to, avg 2µs/call # spent 282µs making 144 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::applies_to, avg 2µs/call # spent 281µs making 144 calls to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::applies_to, avg 2µs/call # spent 280µs making 144 calls to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::applies_to, avg 2µs/call # spent 276µs making 144 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::applies_to, avg 2µs/call # spent 276µs making 144 calls to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::applies_to, avg 2µs/call # spent 272µs making 144 calls to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::applies_to, avg 2µs/call # spent 267µs making 144 calls to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::applies_to, avg 2µs/call # spent 263µs making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::applies_to, avg 2µs/call # spent 262µs making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::applies_to, avg 2µs/call # spent 259µs making 144 calls to Perl::Critic::Policy::Modules::RequireBarewordIncludes::applies_to, avg 2µs/call # spent 258µs making 144 calls to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::applies_to, avg 2µs/call
1663024316µs my @elements;
16730241.36ms if ($type eq 'PPI::Document') {
168 @elements = ($doc);
169 }
170 else {
171273612.3ms273617.3ms @elements = @{ $doc->find($type) || [] };
# spent 17.3ms making 2736 calls to Perl::Critic::Document::find, avg 6µs/call
172 }
173
174 ELEMENT:
17530245.54ms for my $element (@elements) {
176
177 # Evaluate the policy on this $element. A policy may
178 # return zero or more violations. We only want the
179 # violations that occur on lines that have not been
180 # disabled.
181
182 VIOLATION:
183136782272ms1367825.65s for my $violation ( $policy->violates( $element, $doc ) ) {
# spent 1.34s making 1016 calls to Perl::Critic::Policy::Subroutines::ProhibitNestedSubs::violates, avg 1.32ms/call # spent 630ms making 13481 calls to Perl::Critic::Policy::Subroutines::ProhibitReturnSort::violates, avg 47µs/call # spent 620ms making 13481 calls to Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef::violates, avg 46µs/call # spent 431ms making 144 calls to Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::violates, avg 3.00ms/call # spent 413ms making 13481 calls to Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen::violates, avg 31µs/call # spent 322ms making 13481 calls to Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles::violates, avg 24µs/call # spent 315ms making 13481 calls to Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless::violates, avg 23µs/call # spent 305ms making 13481 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitSleepViaSelect::violates, avg 23µs/call # spent 293ms making 13481 calls to Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval::violates, avg 22µs/call # spent 277ms making 1299 calls to Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::violates, avg 213µs/call # spent 195ms making 8379 calls to Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest::violates, avg 23µs/call # spent 167ms making 13481 calls to Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::violates, avg 12µs/call # spent 151ms making 13481 calls to Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::violates, avg 11µs/call # spent 51.3ms making 1016 calls to Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes::violates, avg 50µs/call # spent 37.1ms making 982 calls to Perl::Critic::Policy::Modules::ProhibitEvilModules::violates, avg 38µs/call # spent 33.5ms making 504 calls to Perl::Critic::Policy::Variables::RequireLexicalLoopIterators::violates, avg 66µs/call # spent 27.1ms making 144 calls to Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage::violates, avg 188µs/call # spent 20.9ms making 982 calls to Perl::Critic::Policy::Modules::RequireBarewordIncludes::violates, avg 21µs/call # spent 20.3ms making 982 calls to Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict::violates, avg 21µs/call # spent 104µs making 5 calls to Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::violates, avg 21µs/call
184
18536µs36µs my $line = $violation->location()->[0];
# spent 6µs making 3 calls to Perl::Critic::Violation::location, avg 2µs/call
18635µs312µs if ( $doc->line_is_disabled_for_policy($line, $policy) ) {
# spent 12µs making 3 calls to Perl::Critic::Document::line_is_disabled_for_policy, avg 4µs/call
18735µs38µs $doc->add_suppressed_violation($violation);
# spent 8µs making 3 calls to Perl::Critic::Document::add_suppressed_violation, avg 3µs/call
18832µs next VIOLATION;
189 }
190
191 push @violations, $violation;
192 last TYPE if defined $maximum_violations and @violations >= $maximum_violations;
193 }
194 }
195 }
196
19730246.52ms return @violations;
198}
199
200#-----------------------------------------------------------------------------
201
202
# spent 4.52ms (1.74+2.77) within Perl::Critic::_futz_with_policy_order which was called 144 times, avg 31µs/call: # 144 times (1.74ms+2.77ms) by Perl::Critic::_gather_violations at line 134, avg 31µs/call
sub _futz_with_policy_order {
203 # The ProhibitUselessNoCritic policy is another special policy. It
204 # deals with the violations that *other* Policies produce. Therefore
205 # it needs to be run *after* all the other Policies. TODO: find
206 # a way for Policies to express an ordering preference somehow.
207
208144165µs my @policy_objects = @_;
20914472µs my $magical_policy_name = 'Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic';
21031683.16ms1442.77ms my $idx = firstidx {ref $_ eq $magical_policy_name} @policy_objects;
# spent 2.77ms making 144 calls to List::MoreUtils::firstidx, avg 19µs/call
211144165µs push @policy_objects, splice @policy_objects, $idx, 1;
212144552µs return @policy_objects;
213}
214
215#-----------------------------------------------------------------------------
216
21714µs1;
218
- -
221__END__