-
-
Save lbargaoanu/b8741d0c102b5b969f07d78363a8f9fd 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
$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