Commit 092eacfc authored by Maxim Ivanov's avatar Maxim Ivanov
Browse files

chore(matchmaker): extract logic into sendMatchmakingResult method

parent 7bdab225
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -548,6 +548,11 @@ func (m *LocalMatchmaker) Process() {

	m.Unlock()

	m.sendMatchMakingResult(matchedEntries)
}

// sendMatchMakingResult notifies all presences which found their match
func (m *LocalMatchmaker) sendMatchMakingResult(matchedEntries [][]*MatchmakerEntry) {
	if matchedEntriesCount := len(matchedEntries); matchedEntriesCount > 0 {
		wg := &sync.WaitGroup{}
		wg.Add(matchedEntriesCount)