projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow 'route' to find all routable things instead of just nodes
[spider.git]
/
perl
/
Route
/
Node.pm
diff --git
a/perl/Route/Node.pm
b/perl/Route/Node.pm
index 4bb4c9ca4812624e43b6ed9170f7504c1d17c16a..51ecedea2bb6575c9d58220cba96011e696cd9e4 100644
(file)
--- a/
perl/Route/Node.pm
+++ b/
perl/Route/Node.pm
@@
-56,24
+56,14
@@
sub max
sub add
{
my $parent = shift;
sub add
{
my $parent = shift;
- my $call = shift;
- my $self;
-
- if (ref $call) {
- $self = $call;
- $call = $self->{call};
- } else {
- $self = get($call);
- }
-
- confess "Trying to add NULL Node call to routing tables" unless $call;
-
+ my $call = uc shift;
+ confess "Route::add trying to add $call to myself" if $call eq $parent->{call};
+ my $self = get($call);
if ($self) {
$self->_addparent($parent->{call});
$parent->_addnode($call);
return undef;
}
if ($self) {
$self->_addparent($parent->{call});
$parent->_addnode($call);
return undef;
}
- confess "Route::Node::add trying to add $call to myself" if $call eq $parent->{call};
$parent->_addnode($call);
$self = $parent->new($call, @_);
return $self;
$parent->_addnode($call);
$self = $parent->new($call, @_);
return $self;