This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl5db] Extract a function.
authorShlomi Fish <shlomif@shlomifish.org>
Sun, 30 Sep 2012 12:17:09 +0000 (14:17 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:29 +0000 (09:18 -0500)
lib/perl5db.pl

index 11515fd..6044fb5 100644 (file)
@@ -4741,33 +4741,37 @@ sub _delete_all_breakpoints {
     return;
 }
 
     return;
 }
 
-sub delete_breakpoint {
-    my $i = shift;
+sub _delete_breakpoint_from_line {
+    my ($i) = @_;
 
 
-    my $fn = $filename;
+    # Woops. This line wasn't breakable at all.
+    die "Line $i not breakable.\n" if $dbline[$i] == 0;
 
 
-    # If we got a line, delete just that one.
-    if ( defined($i) ) {
+    # Kill the condition, but leave any action.
+    $dbline{$i} =~ s/\A[^\0]*//;
 
 
-        # Woops. This line wasn't breakable at all.
-        die "Line $i not breakable.\n" if $dbline[$i] == 0;
+    # Remove the entry entirely if there's no action left.
+    if ($dbline{$i} eq '') {
+        _remove_breakpoint_entry($filename, $i);
+    }
 
 
-        # Kill the condition, but leave any action.
-        $dbline{$i} =~ s/\A[^\0]*//;
+    return;
+}
 
 
-        # Remove the entry entirely if there's no action left.
-        if ($dbline{$i} eq '') {
-            _remove_breakpoint_entry($fn, $i);
-        }
-    }
+sub delete_breakpoint {
+    my $i = shift;
 
 
+    # If we got a line, delete just that one.
+    if ( defined($i) ) {
+        _delete_breakpoint_from_line($i);
+    }
     # No line; delete them all.
     else {
         _delete_all_breakpoints();
     # No line; delete them all.
     else {
         _delete_all_breakpoints();
-    } ## end else [ if (defined($i))
+    }
 
     return;
 
     return;
-} ## end sub delete_breakpoint
+}
 
 =head3 cmd_stop (command)
 
 
 =head3 cmd_stop (command)