Skip to content

Commit

Permalink
removed unnecessary building of $error. This closes ticket #13.
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Apr 13, 2012
1 parent 589c02d commit 1f71e86
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions Mechanize.pm
Expand Up @@ -307,20 +307,7 @@ sub submit_form_ok {
# return from submit_form() is an HTTP::Response or undef # return from submit_form() is an HTTP::Response or undef
my $response = $self->submit_form( %{$parms} ); my $response = $self->submit_form( %{$parms} );


my $ok; my $ok = $response && $response->is_success;
my $error;
if ( !$response ) {
$error = 'No matching form found';
}
else {
if ( $response->is_success ) {
$ok = 1;
}
else {
$error = $response->as_string;
}
}

$ok = $self->_maybe_lint( $ok, $desc ); $ok = $self->_maybe_lint( $ok, $desc );


return $ok; return $ok;
Expand Down Expand Up @@ -365,20 +352,7 @@ sub follow_link_ok {
# return from follow_link() is an HTTP::Response or undef # return from follow_link() is an HTTP::Response or undef
my $response = $self->follow_link( %{$parms} ); my $response = $self->follow_link( %{$parms} );


my $ok; my $ok = $response && $response->is_success;
my $error;
if ( !$response ) {
$error = 'No matching link found';
}
else {
if ( $response->is_success ) {
$ok = 1;
}
else {
$error = $response->as_string;
}
}

$ok = $self->_maybe_lint( $ok, $desc ); $ok = $self->_maybe_lint( $ok, $desc );


return $ok; return $ok;
Expand Down

0 comments on commit 1f71e86

Please sign in to comment.