Skip to content
Snippets Groups Projects
Commit 96e5ced8 authored by cyan's avatar cyan
Browse files

* As per Deuce, optimize do_join. Tests show that a regexp search is much

  faster by using system.timer to measure CPU usage over 10,000 loops:
test 1 (Cyan's Method): 5.031109094619751
test 2 (Deuce's Method): 0.26767897605895996
parent 6f32fc53
No related branches found
No related tags found
No related merge requests found
......@@ -546,9 +546,7 @@ function IRCClient_do_join(chan_name,join_key) {
return 0;
}
for (theChar in chan_name) {
var theChar_code = chan_name[theChar].charCodeAt(0);
if ((theChar_code <= 32) || (theChar_code == 44) ||
(chan_name[theChar].charCodeAt(0) == 160)) {
if(chan_name.search(/[\x00-\x20\x2c\xa0]/)!=-1) {
if (this.local)
this.numeric(479, chan_name
+ " :Channel name contains illegal characters.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment