Skip to content

Refactor map initialization in DefaultUriBuilderFactory to use CollectionUtils#36763

Open
shenjianeng wants to merge 1 commit into
spring-projects:mainfrom
shenjianeng:hashmap-size
Open

Refactor map initialization in DefaultUriBuilderFactory to use CollectionUtils#36763
shenjianeng wants to merge 1 commit into
spring-projects:mainfrom
shenjianeng:hashmap-size

Conversation

@shenjianeng
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: shenjianeng <ishenjianeng@qq.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 8, 2026
Copy link
Copy Markdown
Contributor

@DhruvTheDev1 DhruvTheDev1 left a comment

Choose a reason for hiding this comment

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

Solid micro-optimisation!
Map<String, Object> map = CollectionUtils.newHashMap(defaultUriVariables.size() + uriVars.size());Ensures the map is pre-sized to handle the combined size of defaultUriVariables and uriVars without needing to rehash/resize. Logic remains consistent with the existing URI behaviour.

@rstoyanchev rstoyanchev self-assigned this May 21, 2026
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 21, 2026
@rstoyanchev rstoyanchev added this to the 7.0.8 milestone May 21, 2026
@rstoyanchev rstoyanchev changed the title Refactor map initialization using CollectionUtils Refactor map initialization in DefaultUriBuilderFactory to use CollectionUtils May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants