Created
June 18, 2012 13:02
-
-
Save mkrueger/2948267 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
void Example3 () | |
{ | |
// More stingy case. Equivalent to Example2() only if MainClass is of reference type. | |
// Also, how to decide whether the assignments after the Add() calls belong to the previous | |
// or the next call to Add()? Needs data flow/dependency analysis? | |
MainClass tmp; | |
var items = new List<MainClass> (); | |
tmp = new MainClass (); | |
items.Add (tmp); | |
tmp.Data = "data"; | |
tmp.Data2 = "data2"; | |
tmp = new MainClass (); | |
items.Add (tmp); | |
tmp.Data = "data"; | |
tmp.Data2 = "data2"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment