Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 7, 2012
1 parent 8046ba6 commit d058f31
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.65 2012-12-06
3.65 2012-12-07
- Added is_range method to Mojo::Asset.
- Improved documentation.
- Improved tests.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message.pm
Expand Up @@ -34,7 +34,7 @@ sub body {
return $content->unsubscribe('read')->on(read => sub { $self->$new(pop) });
}

# Set text content
# Set raw content
else { $content->asset(Mojo::Asset::Memory->new->add_chunk($new)) }

return $self;
Expand Down
6 changes: 2 additions & 4 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -319,8 +319,9 @@ sub _finish {
}
}

# Callback
# Stop event loop if necessary
$self->$cb($tx);
$self->ioloop->stop unless $self->{nb};
}

sub _handle {
Expand Down Expand Up @@ -356,9 +357,6 @@ sub _handle {
$self->_finish($new || $old, $c->{cb}, $close)
unless $self->_redirect($c, $old);
}

# Stop event loop if necessary
$self->ioloop->stop if !$self->{nb} && !keys %{$self->{connections}};
}

sub _loop { $_[0]->{nb} ? Mojo::IOLoop->singleton : $_[0]->ioloop }
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Command/generate/app.pm
Expand Up @@ -21,7 +21,7 @@ EOF
$self->render_to_rel_file('mojo', "$name/script/$name", $class);
$self->chmod_file("$name/script/$name", 0744);

# Appclass
# Application class
my $app = class_to_path $class;
$self->render_to_rel_file('appclass', "$name/lib/$app", $class);

Expand All @@ -33,13 +33,13 @@ EOF
# Test
$self->render_to_rel_file('test', "$name/t/basic.t", $class);

# Log
# Log directory
$self->create_rel_dir("$name/log");

# Static
# Static file
$self->render_to_rel_file('static', "$name/public/index.html");

# Layout and Templates
# Templates
$self->render_to_rel_file('layout',
"$name/templates/layouts/default.html.ep");
$self->render_to_rel_file('welcome',
Expand Down

0 comments on commit d058f31

Please sign in to comment.