a text on optimizing C++

David Faure kde-optimize@mail.kde.org
Fri, 24 Jan 2003 23:43:38 +0100


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 24 January 2003 23:29, Waldo Bastian wrote:
> On Friday 24 January 2003 20:07, Martijn Klingens wrote:
> > On Friday 24 January 2003 14:13, Lubos Lunak wrote:
> > >  {
> > >  KConfig cfg( "somerc" );
> > >  cfg.writeEntry( "Entry", "Value" );
A setGroup is missing, right?

> > >  }
> > >
> > >  is exactly the same (and the {}'s are not needed if the calling of t=
he
> > > destructor may wait until the end of the function/block it's in). It
> > > saves one dynamic allocation and deallocation, and there will be no l=
eak.
> >
> > What are your thoughts on
> >
> > KConfig( "somerc" ).writeEntry( ... );
There's no group here either.

> > then? I sometimes tend to fold statements together like this but I hard=
ly
> > see it done elsewhere, making me wonder if it's maybe a bad habit of mi=
ne.
The best way is rather something like
KConfigGroup( KGlobal::config(), "mygroup" ).writeEntry( key, value );
(for a single entry to be written).

=2D --=20
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Klar=E4lvdalens Datakonsult AB, Platform-independent software solutions
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2.1 is available - http://download.kde.org/stable/koffice-1.2.1/
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+McGa72KcVAmwbhARAhlTAJ9/ENNEwFT/uQ7pQ/Up5Gi7GQee3gCcC4Rq
9iO+av+L5HzTXLsN8/nkqY4=3D
=3Dle08
=2D----END PGP SIGNATURE-----