daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. foreach (int data in dataList)
  2. {
  3.     PreProcess(data);
  4. }
  5. foreach (int data in dataList)
  6. {
  7.     Process(data);
  8. }
  9.      
  10. foreach (int data in dataList)
  11. {
  12.     PreProcess(data);
  13.     Process(data); // Cannot be run in the same loop with PreProcess(data);
  14. }
  15.      
  16. dataList.ForEach(data => { PreProcess(data); });
  17. dataList.ForEach(data => { Process(data); });
  18.      
  19. Action<Action<int>> myLoop= action =>
  20. {
  21.     foreach (var data in dataList)
  22.     {
  23.         action(data);
  24.     }
  25. };
  26.      
  27. myLoop(Process)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top