Fix: use correctly last record

This commit is contained in:
Dreamacro
2019-09-26 10:08:50 +08:00
parent 1a8a6d0b5d
commit 904c354ee4
2 changed files with 7 additions and 7 deletions

View File

@ -114,11 +114,11 @@ func (p *Proxy) LastDelay() (delay uint16) {
return max
}
head := p.history.First()
if head == nil {
last := p.history.Last()
if last == nil {
return max
}
history := head.(C.DelayHistory)
history := last.(C.DelayHistory)
if history.Delay == 0 {
return max
}