Re: best way to enumerate List<> & remove unwanted elements?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You wrote:

"No, you don't decrement (i) like that, you're going to eventually blow up
at that RemoveAt(i)"

That statement is simply false.

Exactly. It's funny how the current argument has absolutely nothing
to do with the initial claim. The initial claim is simply wrong.

Mr. Arnold, you claim that my original code was wrong is simply
false. If you're trying to make a statement other than this, then you
need to be very clear about what you are talking about, and you should
clear up what you meant to say instead of the above. I have come to
the same conclusions as to what you're trying to get at as Peter has,
and your reaction is that he's putting words in your mouth. But, no
one is reading your mind, so all we can go by is your words, and
that's how we are dervied what your argument is. Right now, you're
doing a poor job of explaining what exactly is wrong with my (ugly)
code, so we're struggling to understand where you're coming from,
especially when the code is 100% legitimate and will never blow up.

The only thing I can get from you is that it's Bad News to mess with
the loop iterator within the loop. But, the way loops are implemented
are well defined, so this is ok.

I am completely lost with your position.

Zytan

.



Relevant Pages

  • Re: for(;;) or while(1)?
    ... Not funny. ... Nitpickery isn't offswitchable. ... >> The second one is horrid. ... > somewhere in a function you call in your loop, ...
    (comp.lang.c)
  • Re: map/filter/reduce/lambda opinions and background unscientific mini-survey
    ... > *No more NamesError exceptions! ... So you could do lot's of funny things like: ... > *No initialization needed for a while loop! ... many places the variable could or could not be set, your program design ...
    (comp.lang.python)
  • Re: [RFC/PATCH] Fixes for ULi5261 (tulip driver)
    ... The funny thing is that it seems the _first_ phy_read call always ... returns only when the 0x8000 bit is gone (I got this while loop from the ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Who Liked George Carlin?
    ... funny when he forgot to update his act. ... 24 hour loop. ... Making fun of the Catholic ...
    (rec.sport.football.college)
  • Re: More C# to VB
    ... :>: Your second example uses the postfix decrement operator which ... :> This is generate the following console output: ... :> Public Shared Sub Main ...
    (microsoft.public.dotnet.languages.vb)