[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash/server dlist.cpp

From: strk
Subject: Re: [Gnash-commit] gnash/server dlist.cpp
Date: Wed, 23 Aug 2006 23:44:32 +0200

On Wed, Aug 23, 2006 at 05:03:11PM +0200, Bastiaan Jacques wrote:

> What about:
> for (iterator it = _characters.begin(); it != _characters.end(); ++it) {
>  // ..
> }
> ? 
> This would save you a copy and (I believe) would be safer than the 
> original.

If the container can change (as the comments suggest)
we need more info about "how" could it change, as I don't think
that testing for .end() would be enough to be "safe".

Copying the full list might actually be the "safest" approach.

BTW, I've verified in the past that testing for .end() or .size() and
friends in a for condition is actually slower then caching it in
the initializer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]