Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
small optimizations
  • Loading branch information
kraih committed Feb 8, 2013
1 parent 0cc36c0 commit d4a0998
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.85 2013-02-07
3.85 2013-02-08
- Updated jQuery to version 1.9.1.
- Improved documentation.
- Improved tests.
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojo/Path.pm
Expand Up @@ -39,9 +39,8 @@ sub canonicalize {
sub clone {
my $self = shift;
my $clone = Mojo::Path->new;
$clone->leading_slash($self->leading_slash);
$clone->trailing_slash($self->trailing_slash);
return $clone->charset($self->charset)->parts([@{$self->parts}]);
$clone->$_($self->$_) for qw(charset leading_slash trailing_slash);
return $clone->parts([@{$self->parts}]);
}

sub contains {
Expand Down
6 changes: 1 addition & 5 deletions lib/Mojo/URL.pm
Expand Up @@ -45,13 +45,9 @@ sub clone {
my $self = shift;

my $clone = Mojo::URL->new;
$clone->scheme($self->scheme);
$clone->userinfo($self->userinfo);
$clone->host($self->host);
$clone->port($self->port);
$clone->$_($self->$_) for qw(scheme userinfo host port fragment);
$clone->path($self->path->clone);
$clone->query($self->query->clone);
$clone->fragment($self->fragment);
$clone->base($self->base->clone) if $self->{base};

return $clone;
Expand Down

0 comments on commit d4a0998

Please sign in to comment.