Skip to content

Instantly share code, notes, and snippets.

@lbargaoanu
Created July 26, 2016 14:40
Show Gist options
  • Save lbargaoanu/b8741d0c102b5b969f07d78363a8f9fd to your computer and use it in GitHub Desktop.
Save lbargaoanu/b8741d0c102b5b969f07d78363a8f9fd to your computer and use it in GitHub Desktop.
$typeMapDestination.Foos = .Block(
System.Collections.Generic.List`1[Benchmark.Flattening.ComplexTypeMapper+Foo] $collectionDestination,
System.Collections.Generic.List`1[Benchmark.Flattening.ComplexTypeMapper+Foo] $passedDestination) {
$passedDestination = .If ($dest == null) {
.Default(System.Collections.Generic.List`1[Benchmark.Flattening.ComplexTypeMapper+Foo])
} .Else {
$typeMapDestination.Foos
};
$collectionDestination = .If ($passedDestination != null) {
$passedDestination
} .Else {
.New System.Collections.Generic.List`1[Benchmark.Flattening.ComplexTypeMapper+Foo]()
};
.If ($resolvedValue == null) {
$collectionDestination
} .Else {
.Block() {
.Block(System.Collections.Generic.List`1+Enumerator[Benchmark.Flattening.ComplexTypeMapper+Foo] $enumerator) {
$enumerator = .Call $resolvedValue.GetEnumerator();
.Loop {
.If (.Call $enumerator.MoveNext() == True) {
.Block(Benchmark.Flattening.ComplexTypeMapper+Foo $item) {
$item = $enumerator.Current;
.Call $collectionDestination.Add(.Call $ctxt.Map(
$item,
.Default(Benchmark.Flattening.ComplexTypeMapper+Foo)))
}
} .Else {
.Break LoopBreak { }
}
}
.LabelTarget LoopBreak:
};
$collectionDestination
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment