| 1 | package Forest::Tree::Indexer::SimpleUIDIndexer; | ||||||||||
| 2 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 4 | our $VERSION = '0.10'; | |||||||||
| 5 | 4 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||
| 6 | |||||||||||
| 7 | 4 | with 'Forest::Tree::Indexer'; | |||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | sub build_index { | ||||||||
|
Subroutine
build_index: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 10 | 3 | my $self = shift; | |||||||||
| 11 | 3 | my $root = $self->get_root; | |||||||||
| 12 | 3 | my $index = $self->index; | |||||||||
| 13 | |||||||||||
| 14 | 3 | ▶ | (!exists $index->{$root->uid}) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | || confess "Tree root has already been indexed, you must clear it before re-indexing"; | ||||||||||
| 16 | |||||||||||
| 17 | 3 | $index->{$root->uid} = $root; | |||||||||
| 18 | |||||||||||
| 19 | 21 | ▶ | $root->traverse(sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||
| 20 | 21 | my $t = shift; | |||||||||
| 21 | 21 | ▶ | (!exists $index->{$t->uid}) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | || confess "Duplicate tree id (" . $t->uid . ") found"; | ||||||||||
| 23 | 21 | $index->{$t->uid} = $t; | |||||||||
| 24 | 3 | }); | |||||||||
| 25 | |||||||||||
| 26 | }; | ||||||||||
| 27 | |||||||||||
| 28 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 29 | |||||||||||
| 30 | 4 | ▶ | no Moose; 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||