Skip to content

Comments

feat(data_structures): SliceIterExt extension trait#12294

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-15-feat_data_structures_sliceiterext_extension_trait
Jul 16, 2025
Merged

feat(data_structures): SliceIterExt extension trait#12294
graphite-app[bot] merged 1 commit intomainfrom
07-15-feat_data_structures_sliceiterext_extension_trait

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 15, 2025

Introduce SliceIterExt extension trait, to add methods to std::slice::Iter and std::slice::IterMut for advancing the iterators.

  • next_unchecked - Get next item from iterator without checking if iterator is empty.
  • advance - Move iterator forwards by a number of items.
  • advance_unchecked - Move iterator forwards by a number of items, without bounds checks.

We have various implementations of these in various places in the codebase (and slightly different implementations of them each time), so it's better to centralize the implementation in one place.

Copy link
Member Author

overlookmotel commented Jul 15, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 15, 2025

CodSpeed Instrumentation Performance Report

Merging #12294 will not alter performance

Comparing 07-15-feat_data_structures_sliceiterext_extension_trait (7cb4d22) with main (4d88252)

Summary

✅ 34 untouched benchmarks

@graphite-app graphite-app bot changed the base branch from 07-15-perf_transform_styled-components_optimize_removal_loop to graphite-base/12294 July 15, 2025 17:36
@overlookmotel overlookmotel force-pushed the 07-15-feat_data_structures_sliceiterext_extension_trait branch from 796c133 to 152a4a1 Compare July 15, 2025 17:48
@overlookmotel overlookmotel changed the base branch from graphite-base/12294 to 07-15-perf_transform_styled-components_optimize_removal_loop July 15, 2025 17:48
@overlookmotel overlookmotel requested a review from Dunqing as a code owner July 15, 2025 17:48
@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Jul 15, 2025
Base automatically changed from 07-15-perf_transform_styled-components_optimize_removal_loop to main July 15, 2025 17:56
@graphite-app graphite-app bot force-pushed the 07-15-feat_data_structures_sliceiterext_extension_trait branch from 152a4a1 to e253552 Compare July 15, 2025 17:56
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jul 16, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 16, 2025

Merge activity

Introduce `SliceIterExt` extension trait, to add methods to `std::slice::Iter` and `std::slice::IterMut` for advancing the iterators.

* `next_unchecked` - Get next item from iterator without checking if iterator is empty.
* `advance` - Move iterator forwards by a number of items.
* `advance_unchecked` - Move iterator forwards by a number of items, without bounds checks.

We have various implementations of these in various places in the codebase (and slightly different implementations of them each time), so it's better to centralize the implementation in one place.
@graphite-app graphite-app bot force-pushed the 07-15-feat_data_structures_sliceiterext_extension_trait branch from e253552 to 7cb4d22 Compare July 16, 2025 01:31
@graphite-app graphite-app bot merged commit 7cb4d22 into main Jul 16, 2025
25 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 16, 2025
@graphite-app graphite-app bot deleted the 07-15-feat_data_structures_sliceiterext_extension_trait branch July 16, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant