[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: kdenonbeta/kopete/kopete/protocols/msn
From: Marc Mutz <mutz () kde ! org>
Date: 2002-04-11 20:07:17
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 11 April 2002 10:29, Martijn Klingens wrote:
> On Wednesday 10 April 2002 22:34, Carsten Pfeiffer wrote:
> > What about adding some strategic "&"s everywhere?
>
> For passing on QStrings? I deliberately didn't, because I thought that was
> pointless for QStrings (explicit sharing and stuff)...
<snip>
QString::operator= isn't inlined, so you have at least the overhead of a
function call.
FTR: You should always try to pass objects by const reference if possible. The
reference so that you don't need a copy-ctor/operator= for the argument class
and the const so you can use temporaries, which are always const, like:
// implicitely calls QString( const char * ) ctor:
void removeContract( "myUserID" );
This doesn't apply to QStrings, but it's a good idea to always do it that way
(so one isn't tempted to do it otherwise _when_ it matters).
Marfc
- --
Marc Mutz <mutz@kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8tez13oWD+L2/6DgRAl8UAJwPUCQ4mD7hQT3GXqLQr8KGeXXKmwCgu/4E
uWe5+Jdza3HTHLOnzG8rMic=
=TIdm
-----END PGP SIGNATURE-----
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic