Skip to content

use map.foreach directly instead of entrySet.foreach#16

Merged
filiphr merged 1 commit intomapstruct:mainfrom
hduelme:use-map.foreach-directly-instead-of-stream.foreach
Feb 14, 2026
Merged

use map.foreach directly instead of entrySet.foreach#16
filiphr merged 1 commit intomapstruct:mainfrom
hduelme:use-map.foreach-directly-instead-of-stream.foreach

Conversation

@hduelme
Copy link
Contributor

@hduelme hduelme commented Feb 12, 2026

Since Map has a built-in forEach, we can avoid creating a stream and simplify this code by using map.forEach( (key, value) -> ) directly.

@hduelme hduelme changed the title use map.foreach directly instead of stream.foreach use map.foreach directly instead of entrySet.foreach Feb 12, 2026
@filiphr filiphr added the enhancement New feature or request label Feb 14, 2026
@filiphr filiphr added this to the 1.0.0.Alpha4 milestone Feb 14, 2026
@filiphr filiphr merged commit b0dd5d5 into mapstruct:main Feb 14, 2026
6 checks passed
@filiphr
Copy link
Member

filiphr commented Feb 14, 2026

Thanks @hduelme

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants