lastMatchedLineIndex returns the index of the last line that matches a regex, or -1 if no match is found.
(re *regexp.Regexp)
| 133 | // lastMatchedLineIndex returns the index of the last line that matches a regex, |
| 134 | // or -1 if no match is found. |
| 135 | func (loc *Location) lastMatchedLineIndex(re *regexp.Regexp) int { |
| 136 | for i := len(loc.Line) - 1; i >= 0; i-- { |
| 137 | if fn := loc.Line[i].Function; fn != nil { |
| 138 | if re.MatchString(fn.Name) || re.MatchString(fn.Filename) { |
| 139 | return i |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | return -1 |
| 144 | } |
| 145 | |
| 146 | // FilterTagsByName filters the tags in a profile and only keeps |
| 147 | // tags that match show and not hide. |
no outgoing calls
no test coverage detected