Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

metrics/json: extract common JSON marshaling logic to eliminate duplication #32988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
prestoalvarez wants to merge 1 commit into ethereum:master from prestoalvarez:patch-3

Conversation

@prestoalvarez
Copy link

@prestoalvarez prestoalvarez commented Oct 21, 2025

Extract shared JSON marshaling logic into a private helper function to eliminate code duplication between StandardRegistry.MarshalJSON and PrefixedRegistry.MarshalJSON.

  • Both registry types had identical MarshalJSON implementations.
  • Duplication increases maintenance burden and risk of inconsistencies.
  • Common logic should be centralized to follow DRY principles.
  • Add private marshalRegistryJSON(r Registry) helper function.
  • Update both MarshalJSON methods to use the shared helper.

Copy link
Contributor

fjl commented Oct 24, 2025

We prefer not to include this change.

@fjl fjl closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /