Skip to content

Refactor map initialization using CollectionUtils#36763

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

Refactor map initialization using CollectionUtils#36763
shenjianeng wants to merge 1 commit intospring-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants