Skip to content

Commit

Permalink
fix: minor performance boost
Browse files Browse the repository at this point in the history
  • Loading branch information
FMotalleb committed Sep 12, 2024
1 parent 63557ef commit c415707
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/event/logfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ func (lf *LogFile) BuildTickChannel() <-chan []string {
for _, line := range strings.Split(data, lf.lineBreaker) {
eventData := []string{"log-file", lf.filePath, line}
matches := lf.matcher.FindStringSubmatch(line)
names := lf.matcher.SubexpNames()

eventData = append(eventData, reshapeRegxpMatch(names, matches)...)
if matches != nil {
names := lf.matcher.SubexpNames()

eventData = append(eventData, reshapeRegxpMatch(names, matches)...)

notifyChan <- eventData
}
}
Expand Down

0 comments on commit c415707

Please sign in to comment.