From a00957fcf5a3b3e126f05598d7f4716d90bba904 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Thu, 9 Jul 2015 15:45:43 -0500 Subject: [PATCH] Reuse existing function for BP by ID lookup Also, kill whitespace to make code appear more as a singular block for readability. --- proc/proc.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/proc/proc.go b/proc/proc.go index 47242f95..61d4b3a2 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -185,11 +185,8 @@ func (dbp *Process) FindLocation(str string) (uint64, error) { if err != nil { return 0, fmt.Errorf("unable to find location for %s", str) } - - for _, bp := range dbp.Breakpoints { - if uint64(bp.ID) == id { - return bp.Addr, nil - } + if bp, ok := dbp.FindBreakpointByID(int(id)); ok { + return bp.Addr, nil } // Last resort, use as raw address