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

List:       kde-devel
Subject:    Re: Two optimization questions
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2004-04-21 7:45:36
Message-ID: 200404210945.41707.kevin.krammer () gmx ! at
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Wednesday 21 April 2004 09:29, Sylvain Joyeux wrote:
> > IIRC (again) QValueList::end() is O(n)
>
> Of course it's not. length() can be O(n) in lists - it is O(1) in Qt, but
> end() is always O(1) in good lists implementations.

Ah, you're right, my memory failed me.
The recommendation is derived from saving unnecessary object creation
"...This avoids the unnecessary creation of the temporary end() return object 
on each loop iteration, largely speeding it up...."

Cheers,
Kevin

-- 
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
www.mrunix.de - Unix/Linux programming forum
www.qtforum.org - Qt programming forum

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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