[Patch] Fix undeleted "static QFont *_font" in kglobalsettings.cpp

Dominik Haumann dhdev at gmx.de
Fri Dec 5 11:16:11 GMT 2008


On Friday 05 December 2008, Thiago Macieira wrote:
> On Friday 05 December 2008 08:58:18 Johannes Sixt wrote:
> > Friedrich W. H. Kossebau schrieb:
> > > 1. How to set an array of pointers all to 0 most efficiently
> > > (mFonts)?
> >
> > #include <algorithm>
> >
> > std::fill_n(mFonts, FontCount, (QFont*)0);
> >
> > or
> >
> > std::fill_n<QFont**,int,QFont*>(mFonts, FontCount, 0);
>
> Proper C++ way of doing it, but less efficient than a simple memset :-)

Maybe it's almost as fast, depending whether the STL implementation uses 
template specialization (for pointers). Or do I miss something? ;)

Dominik




More information about the kde-core-devel mailing list