[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: QList::at and so on :}
From: Lenny <kudling () kde ! org>
Date: 2001-06-26 15:44:01
[Download RAW message or body]
> > of steps in *every* single iteration. Fortunately QList
> > is "sloppy-programmer-safe" and stores the last position
> > as currentNode and uses this information to walk on. So
> > basically it's not *that* bad in reality, but still this
> > can be made faster (and more "beautiful" == understandable
> > for people reading the code) by using iterators:
>
> Of course I fully agree with iterators being nicer :-) , just
> wanted to point out that it is not as bad as it looks like, as the
> Trolls were intelligent enough to catch this very case of at(int) usage.
> So using at in a loop like above (with the index being incremented by one) ,
> at(int) is just as fast as using next() or something like that, as at(int)
> uses the current list node as starting point for the iteration (and sets it
> afterwards, that being the reason for the non-constness :-)
Isnt that basically what Werner said? Or is this what you mean with
"pointing out"?
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic