mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-03 07:45:29 -05:00
optimize map usage
This commit is contained in:
@@ -75,6 +75,10 @@ func (h *SessionHistory) removeExpiredEntries() {
|
||||
h.Lock()
|
||||
defer h.Unlock()
|
||||
|
||||
if len(h.cache) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for session, expire := range h.cache {
|
||||
if expire.Before(now) {
|
||||
delete(h.cache, session)
|
||||
|
||||
Reference in New Issue
Block a user