-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
Based on the current master in sharplab:
The following:
public bool M(object x)
{
return x is "";
}is compiled as:
public bool M(object x)
{
string text = x as string;
if (text != null)
{
return text == "";
}
return false;
}It's a bit more performant if return text == "" is text.Length == 0.
That would be a special-casing for this, which I'm unsure if it's acceptable to the compiler team or not.
category:cq
theme:basic-cq
skill-level:intermediate
cost:small
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Type
Projects
Status
Done