sorcix/sIRC — pull request #15 by jentfoo (2014-10-27 23:49:15+00:00)
Title: Some small performance and thread safety improvements

I saw some small improvements I would recommend. There are others I want to recommend, but these seem like some more obvious inital ones.

In Channel.java I saw you were using a ConcurrentHashMap, but the way you were using it was not thread safe. So I am providing a few recommendations to solve the thread safety in there (I will comment these per line to indicate why the change).

In IrcQueue.java it would be more performant to use an ArrayDeque than a LinkedList here. The only reason you may not want to use it would be if you want to maintain java 1.5 compatability (as it was added in 1.6 I believe).