From 3a7aef8b7a33dc551060f32e1651bde780b9828b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 2 Apr 2008 17:32:47 -0400 Subject: [PATCH] Return the breakpoint when removing in BreakpointManager * Source/BreakpointManager.m/h: ([BreakpointManager removeBreakpointAt:inFile:]): Return the breakpoint that was removed --- Source/BreakpointManager.h | 2 +- Source/BreakpointManager.m | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/BreakpointManager.h b/Source/BreakpointManager.h index 81af299..da8cc03 100644 --- a/Source/BreakpointManager.h +++ b/Source/BreakpointManager.h @@ -24,7 +24,7 @@ + (BreakpointManager *)sharedManager; - (void)addBreakpoint:(Breakpoint *)bp; -- (void)removeBreakpointAt:(int)line inFile:(NSString *)file; +- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file; - (NSSet *)breakpointsForFile:(NSString *)file; - (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file; diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index 8226917..10d8ae7 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -63,9 +63,9 @@ } /** - * Removes a breakpoint at a given line/file combination + * Removes a breakpoint at a given line/file combination, or nil if nothing was removed */ -- (void)removeBreakpointAt:(int)line inFile:(NSString *)file +- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file { NSMutableSet *lines = [breakpoints valueForKey:file]; for (Breakpoint *b in lines) @@ -73,9 +73,10 @@ if ([b line] == line) { [lines removeObject:b]; - return; + return b; } } + return nil; } /** -- 2.43.5