Skip to content

Improve performance of LanguagePrimitives.TryConvertTo #7420

@powercode

Description

@powercode

LanguagePrimitives.TryConvertTo is implemented by wrapping LanguagePrimitives.ConvertTo in exception handling, and return false if it failed.

This can be improved upon by using the ConversionData return from FigureConversion by checking if the Rank is ConversionRank.None before we try to call the conversion.

By doing an early exit, return we avoid the exceptions that are always thrown when there are no available conversions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Engine-Performancecore PowerShell engine, interpreter, and runtime performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions