Last active
          January 1, 2016 22:49 
        
      - 
      
- 
        Save controlflow/8212650 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class C | |
| { | |
| void M(int[] xs) | |
| { | |
| var firstTime = true; | |
| foreach (var x in xs) | |
| { | |
| // меня так раздражает тратить столько строк и целый блок на такую конструкцию | |
| if (firstTime) | |
| { | |
| doSmth(); | |
| firstTime = false; | |
| } | |
| doStuff(); | |
| } | |
| var firstTime = true; | |
| foreach (var x in xs) | |
| { | |
| // что записал ее так: | |
| for (; firstTime; firstTime = false) | |
| doSmth(); | |
| doStuff(); | |
| } | |
| } | |
| } | |
| // имеет оно право на жизнь? или нихрена не понятно | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
понятно, но лучше первый вариант :)