Andras Daniel TothAndras Daniel Toth

My feedback

  1. 38 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      12 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
      Andras Daniel TothAndras Daniel Toth commented  · 

      Why don't you refactor these loops into a method? Then you can use 'return'.

      public Stuff DoingMyNestedLoop()
      {
      for
      {
      for
      {
      if (true) return stuff;
      }
      }
      }

      usage:
      for (;;)
      {
      DoingMyNestedLoop();
      }

      It will exit all inner loops except for your only outer loop. :)

    Feedback and Knowledge Base