-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersConcept-Design DebtEngineering Debt, Design Debt, or poor product code qualityEngineering Debt, Design Debt, or poor product code quality
Milestone
Description
roslyn/src/Compilers/Core/Portable/Collections/ImmutableArrayExtensions.cs
Lines 971 to 995 in 7c23c2e
| bool hasType = false; | |
| bool hasNamespace = false; | |
| foreach (var symbol in members) | |
| { | |
| if (symbol is TNamedTypeSymbol) | |
| { | |
| hasType = true; | |
| if (hasNamespace) | |
| { | |
| break; | |
| } | |
| } | |
| else | |
| { | |
| #if DEBUG | |
| Debug.Assert(symbol is TNamespaceSymbol); | |
| #endif | |
| hasNamespace = true; | |
| if (hasType) | |
| { | |
| break; | |
| } | |
| } | |
| } |
It looks like members.As<TNamedTypeSymbol>() can be used to quickly detect a situation when hasType is true && hasNamespace is false
Metadata
Metadata
Assignees
Labels
Area-CompilersConcept-Design DebtEngineering Debt, Design Debt, or poor product code qualityEngineering Debt, Design Debt, or poor product code quality