Skip to content

Remove redundant null-forgiving operator in MamJsonParser.ReadClassRewrites#11772

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-reduntant-null-forgiving-operator
Draft

Remove redundant null-forgiving operator in MamJsonParser.ReadClassRewrites#11772
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-reduntant-null-forgiving-operator

Conversation

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

MamJsonParser.ReadClassRewrites used the ! null-forgiving operator on classRewrite, which is already proven non-null by the if (classRewrite == null) continue; guard immediately above. This violates the repo rule against using ! and is redundant—the sibling ReadGlobalMethodCalls makes the identical call without it.

Changes

  • Drop the ! from the TryReadClassFromTo call in ReadClassRewrites:
- if (!TryReadClassFromTo (classRewrite!, out var from, out var to)) {
+ if (!TryReadClassFromTo (classRewrite, out var from, out var to)) {

No other lines changed. The out-of-scope JsonNode.Parse ("{}")! in ReadJson was left untouched.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove redundant null-forgiving operator in MamJsonParser.ReadClassRewrites Remove redundant null-forgiving operator in MamJsonParser.ReadClassRewrites Jun 27, 2026
Copilot AI requested a review from jonathanpeppers June 27, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants