Open dchaofei opened 6 years ago
方法里最后一个 break 是不是改为 continue?
func (pder *Provider) SessionGC(maxlifetime int64) { pder.lock.Lock() defer pder.lock.Unlock() for { element := pder.list.Back() if element == nil { break } if (element.Value.(*SessionStore).timeAccessed.Unix() + maxlifetime) < time.Now().Unix() { pder.list.Remove(element) delete(pder.sessions, element.Value.(*SessionStore).sid) } else { break } } }
同感,应该是用continue,为空才break,还有就continue
方法里最后一个 break 是不是改为 continue?