Skip to content

Refactor InternalPrefixedConfig to use StringBuilder for namespace construction#1619

Open
omer-cengel wants to merge 1 commit intoNetflix:masterfrom
omer-cengel:refactor/internal-prefixed-config-string-concat
Open

Refactor InternalPrefixedConfig to use StringBuilder for namespace construction#1619
omer-cengel wants to merge 1 commit intoNetflix:masterfrom
omer-cengel:refactor/internal-prefixed-config-string-concat

Conversation

@omer-cengel
Copy link

Summary

Refactored InternalPrefixedConfig to avoid String concatenation inside a loop by using StringBuilder.

Problem

The constructor of InternalPrefixedConfig was building the namespace prefix using String concatenation (+=) inside a loop, which is less efficient due to repeated String object creation.

Changes Made

  • Replaced String concatenation with StringBuilder in the constructor.
  • Preserved existing behavior for null, empty, and dotted namespace values.
  • Added unit tests to cover edge cases and ensure identical behavior.

Result

The code is more efficient, and clearer, with no behavioral changes.

Fixes

Fixes #1606

Copy link

@marconi-prog marconi-prog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Clean refactor, behavior preserved, and tests added.

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.

Refactor namespace prefix construction to avoid String concatenation in loop

2 participants