1
0
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:
Darien Raymond
2018-05-31 12:05:25 +02:00
parent adade2bffd
commit 4a46817cf6
2 changed files with 6 additions and 6 deletions

View File

@@ -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)