Performance tweak: rem. pointless recursive calls
authorPetr Bena <benapetr@gmail.com>
Wed, 23 Sep 2015 14:07:16 +0000 (16:07 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Jan 2016 16:36:56 +0000 (17:36 +0100)
commite56629542168c203cac8504085fc96c7f7b73d90
treee47e4b2edd3b1906c32e1de30bb3568dcc6e5b3b
parent56a89a792d8a32e6e365620232268ec6eb14dcc7
Performance tweak: rem. pointless recursive calls

For some reason there was an extra call to IrcChannel::joinIrcUser
from IrcUser::joinIrcChannel. That means that in past we did:

* Call to                         IrcChannel::joinIrcUsers(...)
* From there we call              IrcUser::joinIrcChannel(this)
* And from there we called        IrcChannel::joinIrcUser(this)
* Which again called              IrcChannel::joinIrcUsers(list that contained only this 1 user)
* Which figured out this user is already in this channel and exits

That is a pointless overhead, so now we call the second function with
extra parameter that tells it not to call joinIrcUser because we know
this user doesn't need to be added there, thus saves few thousands of
pointless function calls and user list contructions, especially while
joining large channels.
src/common/ircchannel.cpp
src/common/ircuser.cpp
src/common/ircuser.h