Terminate this loop earlier.
This commit is contained in:
parent
09265195bb
commit
6b745a056f
|
@ -105,6 +105,7 @@ func wsTopicListTick(h *WsHubImpl) error {
|
||||||
if !tItem.Sticky {
|
if !tItem.Sticky {
|
||||||
if tItem.ID != h.lastTopicList[j].ID || !tItem.LastReplyAt.Equal(h.lastTopicList[j].LastReplyAt) {
|
if tItem.ID != h.lastTopicList[j].ID || !tItem.LastReplyAt.Equal(h.lastTopicList[j].LastReplyAt) {
|
||||||
hasItem = true
|
hasItem = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +238,7 @@ func (h *WsHubImpl) HasUser(uid int) (exists bool) {
|
||||||
if exists {
|
if exists {
|
||||||
return exists
|
return exists
|
||||||
}
|
}
|
||||||
|
|
||||||
h.oddUserLock.RLock()
|
h.oddUserLock.RLock()
|
||||||
_, exists = h.oddOnlineUsers[uid]
|
_, exists = h.oddOnlineUsers[uid]
|
||||||
h.oddUserLock.RUnlock()
|
h.oddUserLock.RUnlock()
|
||||||
|
|
Loading…
Reference in New Issue