Skip to content

LuaValue's internal TryRead(Type) methods should be public #191

Description

It would be nice to have a fast-lane access to the typed values as opposed to having only TryRead. Unfortunately those are all marked internal.

More often than not I know I'll be reading a number so I'd really like to use TryReadNumber etc instead (copied from LuaValue) since that's much more streamlined and faster at scale:

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    internal bool TryReadNumber(out double result)
    {
        if (Type == LuaValueType.Number)
        {
            result = value;
            return true;
        }

        result = default!;
        return false;
    }

Activity

  1. changed the title [-]LuaValue's internal TryRead(Type) methods should be public, and have a default option[/-] [+]LuaValue's internal TryRead(Type) methods should be public[/+] on Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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