Skip to content

The implementation of ToCamelCase can be optimized #230

@wmjordan

Description

@wmjordan

I am studying the source code today and found that ToCamelCase could be optimized.

The current implementation stack allocates a new char array, works on it and create a string from that char array.

You can use String.Copy to copy an instance of a string, and directly pin the string with a fixed statement and work on that copy. This saves one allocation and quite a few char assignments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions