Navigation Menu

Skip to content

Commit

Permalink
removed even more distracting comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 21, 2011
1 parent 9ac4c32 commit 69fbd68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
24 changes: 6 additions & 18 deletions lib/Mojo/DOM.pm
Expand Up @@ -137,8 +137,6 @@ sub all_text {
my $start = $tree->[0] eq 'root' ? 1 : 4;
my @stack = @$tree[$start .. $#$tree];
while (my $e = shift @stack) {

# Type
my $type = $e->[0];

unshift @stack, @$e[4 .. $#$e] and next if $type eq 'tag';
Expand All @@ -164,7 +162,7 @@ sub attrs {

my $tree = $self->tree;

# Root
# Not a tag
return if $tree->[0] eq 'root';

my $attrs = $tree->[2];
Expand Down Expand Up @@ -247,8 +245,6 @@ sub namespace {

# Walk tree
while ($current) {

# Root
return if $current->[0] eq 'root';

my $attrs = $current->[2];
Expand All @@ -273,7 +269,7 @@ sub parent {

my $tree = $self->tree;

# Root
# Not a tag
return if $tree->[0] eq 'root';

# Parent
Expand Down Expand Up @@ -372,7 +368,6 @@ sub text {
# Meta data
next unless ref $e eq 'ARRAY';

# Type
my $type = $e->[0];

# Text
Expand Down Expand Up @@ -407,7 +402,7 @@ sub type {

my $tree = $self->tree;

# Root
# Not a tag
return if $tree->[0] eq 'root';

# Get
Expand All @@ -427,7 +422,7 @@ sub _add {

my $tree = $self->tree;

# Root
# Not a tag
return $self if $tree->[0] eq 'root';

# Parent
Expand Down Expand Up @@ -560,15 +555,13 @@ sub _end {

warn "END $end\n" if DEBUG;

# Root
# Not a tag
return if $$current->[0] eq 'root';

# Search stack for start tag
my $found = 0;
my $next = $$current;
while ($next) {

# Root
last if $next->[0] eq 'root';

# Found
Expand All @@ -577,7 +570,6 @@ sub _end {
# HTML inline tags stop here
return if !$self->xml && $HTML_BLOCK{$next->[1]} && !$HTML_BLOCK{$end};

# Next
$next = $next->[3];
}

Expand All @@ -587,11 +579,7 @@ sub _end {
# Walk backwards
$next = $$current;
while ($$current = $next) {

# Root
last if $$current->[0] eq 'root';

# Next
$next = $$current->[3];

# Match
Expand Down Expand Up @@ -684,7 +672,7 @@ sub _match_element {
unless $current = $current ? $current->[3] : $candidate;
}

# Root
# Not a tag
return if $current->[0] ne 'tag';

# Compare part to element
Expand Down
9 changes: 5 additions & 4 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -337,10 +337,7 @@ sub listen {
%{$args->{args} || {}}
);

# File
my $file = $args->{file};

# Port
my $port = $args->{port} || 3000;

# File descriptor reuse
Expand Down Expand Up @@ -974,18 +971,22 @@ sub _accept {

sub _add_event {
my ($self, $event, $id, $cb) = @_;

return unless my $c = $self->{_cs}->{$id};
$c->{$event} = $cb if $cb;

return $self;
}

sub _add_loop_event {
my $self = shift;
my $event = shift;
my $cb = shift;
my $e = {cb => $cb, @_};

my $e = {cb => $cb, @_};
(my $id) = "$e" =~ /0x([\da-f]+)/;
$self->{"_$event"}->{$id} = $e;

return $id;
}

Expand Down
3 changes: 0 additions & 3 deletions lib/Mojo/URL.pm
Expand Up @@ -91,15 +91,12 @@ sub authority {
sub clone {
my $self = shift;

# Clone
my $clone = Mojo::URL->new;
$clone->scheme($self->scheme);
$clone->authority($self->authority);
$clone->path($self->path->clone);
$clone->query($self->query->clone);
$clone->fragment($self->fragment);

# Base
$clone->base($self->base->clone) if $self->{base};

return $clone;
Expand Down

0 comments on commit 69fbd68

Please sign in to comment.