perf(engine): avoid FirstOrDefault iterator alloc in TestGenericTypeResolver by thomhurst · Pull Request #6079 · thomhurst/TUnit (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@thomhurst

@thomhurst

…esolver

Replace IEnumerable.FirstOrDefault() with a foreach/break in the generic-type inference fallback. FirstOrDefault on a non-list IEnumerable allocates an enumerator; foreach avoids that while keeping behavior identical. Same pattern as #6029.

Closes #6045

[claude[bot]](/apps/claude)

[claude[bot]](/apps/claude)

@thomhurst thomhurst deleted the perf/issue-6045-testgenerictyperesolver branch

May 28, 2026 18:57

This was referenced

May 29, 2026

This was referenced

Jun 13, 2026

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

[ Show hidden characters]({{ revealButtonHref }})