Skip to content

Commit 39e967b

Browse files
committed
dnsx/alg: m code comment
1 parent a5ff0db commit 39e967b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

intra/dnsx/alg.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (p *xips) merge(q *xips) {
285285
defer q.pmu.RUnlock()
286286

287287
for k, v := range q.pri {
288-
if aa := p.pri[k]; !aa.fresh() {
288+
if aa, ok := p.pri[k]; !ok || !aa.fresh() {
289289
p.pri[k] = v
290290
} else {
291291
ips := copyUniq(aa.alive(), v.alive())
@@ -310,6 +310,7 @@ type baseans struct {
310310
ttl time.Time // ttl for this alg translation
311311
}
312312

313+
// fresh returns false if a has expired or if a is nil
313314
func (a *baseans) fresh() bool {
314315
if a == nil {
315316
return false

0 commit comments

Comments
 (0)