Interested, does approaches has any differences.
So, I created two snippets.
Snippet A
List a = new List();
a.Add(4);
a.Add(6);
int
If you're asking about asymptotic complexity, both approaches are O(1)
, use any of it.
If you're asking about real speed, there's no answer, since it can differ from version to version, from one machine to another. IL you've generated is not the same for any other version of .NET.
Attempt to optimize your code by choosing one of these approaches is obviously premature optimization.