From 216a9dc05efb227bf793e18ec10fcc978f782d21 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 18 May 2014 15:26:50 +0400 Subject: [PATCH] Unnecessary message broadcasting goroutines --- room.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/room.go b/room.go index f92d0e6..87b35f6 100644 --- a/room.go +++ b/room.go @@ -87,7 +87,7 @@ func (room *Room) Processor(events chan ClientEvent) { room.members[client] = true log.Println(client, "joined", room.name) room.SendTopic(client) - go room.Broadcast(fmt.Sprintf(":%s JOIN %s", client, room.name)) + room.Broadcast(fmt.Sprintf(":%s JOIN %s", client, room.name)) room.log_sink <- LogEvent{room.name, client.nickname, "joined", true} nicknames := []string{} for member := range room.members { @@ -163,7 +163,7 @@ func (room *Room) Processor(events chan ClientEvent) { room.StateSave() case EVENT_MSG: sep := strings.Index(event.text, " ") - go room.Broadcast(fmt.Sprintf(":%s %s %s :%s", client, event.text[:sep], room.name, event.text[sep+1:]), client) + room.Broadcast(fmt.Sprintf(":%s %s %s :%s", client, event.text[:sep], room.name, event.text[sep+1:]), client) room.log_sink <- LogEvent{room.name, client.nickname, event.text[sep+1:], false} } }