olahol / melody

:notes: Minimalist websocket framework for Go
BSD 2-Clause "Simplified" License
3.75k stars 366 forks source link

Add convenience function to broadcast to multiple sessions #25

Closed robbiet480 closed 7 years ago

olahol commented 7 years ago

Wouldn't this be better implemented as a loop over the session slice and a call to session.Write? It looks like it's O(n^2) in complexity right now.

robbiet480 commented 7 years ago

@olahol duh! I just had this little bit of code hanging out unused in my private base and didn't think to check it for complexity before submitting. Will get it fixed now.

robbiet480 commented 7 years ago

@olahol Fixed!

olahol commented 7 years ago

Thank you @robbiet480, nice work :+1: