Skip to content

C#: Introduce Expr.getIntValue.#21701

Draft
aschackmull wants to merge 1 commit intogithub:mainfrom
aschackmull:csharp/intvalue
Draft

C#: Introduce Expr.getIntValue.#21701
aschackmull wants to merge 1 commit intogithub:mainfrom
aschackmull:csharp/intvalue

Conversation

@aschackmull
Copy link
Copy Markdown
Contributor

I noticed that the Expr.getValue().toInt() pattern was generating some poor performance due to lots of repeated string operations, so at first I just wanted to cache this to improve performance, but then I noticed that the pattern actually also yields results for string and char literals (e.g. "4" and '4' both yield 4), which is very unlikely to be intended in the various uses of this pattern. So besides improving some performance, this may also fix some bugs.

@github-actions github-actions bot added the C# label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant