Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
improve cache
Browse files Browse the repository at this point in the history
  • Loading branch information
win-t committed Apr 11, 2019
1 parent b247398 commit 4662463
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ func (o *outputRouter) getWriter(ip net.IP) *outputWriter {

var w *outputWriter
o.Lock()
if ret, ok := o.cache[ipnumber]; ok {
return ret.value
}
for _, v := range o.router {
if v.filter.Contains(ip) {
w = v
Expand Down

0 comments on commit 4662463

Please sign in to comment.