[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [Patch] Fix undeleted "static QFont *_font" in kglobalsettings.cpp
From:       Thiago Macieira <thiago () kde ! org>
Date:       2008-12-05 10:31:08
Message-ID: 200812051131.08669.thiago () kde ! org
[Download RAW message or body]


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 :-)

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic