Skip to content

Modernize ResourceChangeEvent.findMarkerDeltas iteration#2666

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:modernize-findmarkerdeltas
Draft

Modernize ResourceChangeEvent.findMarkerDeltas iteration#2666
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:modernize-findmarkerdeltas

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 18, 2026

Replaces the explicit Iterator over markerDeltas.values() with an enhanced for-loop and swaps the terminal toArray(new IMarkerDelta[matching.size()]) for toArray(IMarkerDelta[]::new). The pre-sized array form stopped being the faster idiom once HotSpot started intrinsifying the size-zero/generator variants, and the enhanced for-loop removes the hasNext/next boilerplate. Behaviour is unchanged.

Planned for 4.41

Replace the explicit Iterator over markerDeltas.values() with an enhanced
for-loop and switch the terminal toArray call from the pre-sized
new IMarkerDelta[matching.size()] form to the IMarkerDelta[]::new
generator. The pre-sized form has not been the faster idiom on HotSpot
since the size-zero/generator variants started being intrinsified, and
the enhanced for-loop drops the hasNext/next boilerplate while reading
the iteration intent in one statement.
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   38m 48s ⏱️ + 2m 2s
 4 667 tests ±0   4 645 ✅ ±0   22 💤 ±0  0 ❌ ±0 
11 895 runs  ±0  11 742 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 9927653. ± Comparison against base commit 4149373.

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.

1 participant