Terminate this loop earlier.

This commit is contained in:
Azareal 2019-11-04 17:00:12 +10:00
parent 09265195bb
commit 6b745a056f
1 changed files with 2 additions and 1 deletions

View File

@ -105,6 +105,7 @@ func wsTopicListTick(h *WsHubImpl) error {
if !tItem.Sticky {
if tItem.ID != h.lastTopicList[j].ID || !tItem.LastReplyAt.Equal(h.lastTopicList[j].LastReplyAt) {
hasItem = true
break
}
}
}
@ -237,7 +238,7 @@ func (h *WsHubImpl) HasUser(uid int) (exists bool) {
if exists {
return exists
}
h.oddUserLock.RLock()
_, exists = h.oddOnlineUsers[uid]
h.oddUserLock.RUnlock()