dotnet/roslyn

Refactor `CheckFeatureAvailability` to not accept a `Location` parameter

開放

#68,935 建立於 2023年7月8日

 (1 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-CompilersArea-Performancehelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

Currently, CheckFeatureAvailability overloads take a Location parameter. Causing caller to call syntaxNode.Location which allocates a SourceLocation. At the end, if the feature is available, the allocation is thrown away.

Example:

https://github.com/dotnet/roslyn/blob/b203101cbc6672a9761a7ce4917d26be593aed26/src/Compilers/CSharp/Portable/Binder/Binder_Patterns.cs#L574

Not sure how much this pattern is hit, but it's good to optimize this anyway.

貢獻者指南