Skip to content

Update structs to use new readonly member modifier #812

@Mrnikbobjeff

Description

@Mrnikbobjeff

We have multitudes of structs being non-readonly, and making them readonly would be a breaking change. As some of these structs may be used with the in modifier in user code they will be defensively copied each time a member is accessed or a function is called on the struct. The new c# 8 feature, readonly members allows the compiler to ellide the defensive copy when accessing readonly members. We have tons of places where we easily make these changes without breaking anything (GetHashCode and Equals on structs should NEVER mutate them). This is a mirror of the ticket here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement RequestedProduct code improvement that does NOT require public API changes/additions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions