Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 20, 2025

Add advance_to_end method to SliceIter trait. This allows calling advance_to_end on any slice iterator.

(this stack of 3 PRs is work I did as part of first attempt to build an ESTree walker, which I abandoned, but the APIs are useful for other tasks in oxc_ast_tools).

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Sep 20, 2025
Copy link
Member Author


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.

@overlookmotel overlookmotel marked this pull request as ready for review September 20, 2025 12:02
Copilot AI review requested due to automatic review settings September 20, 2025 12:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an advance_to_end method to the SliceIter trait that efficiently moves the iterator to its end position. This was developed as part of an ESTree walker implementation but provides general utility for iterator manipulation.

  • Adds advance_to_end method to the SliceIter trait that calls advance(self.len())
  • Includes comprehensive test coverage for both mutable and immutable iterator variants
  • Adds inline optimization and performance documentation with Godbolt link

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@overlookmotel overlookmotel self-assigned this Sep 20, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 20, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 20, 2025

CodSpeed Instrumentation Performance Report

Merging #13947 will not alter performance

Comparing 09-16-feat_data_structures_add_advance_to_end_method_to_sliceiter_trait (f8feed1) with main (f1862c4)

Summary

✅ 37 untouched

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 20, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Sep 20, 2025
…it (#13947)

Add `advance_to_end` method to `SliceIter` trait. This allows calling `advance_to_end` on any slice iterator.

(this stack of 3 PRs is work I did as part of first attempt to build an ESTree walker, which I abandoned, but the APIs are useful for other tasks in `oxc_ast_tools`).
@graphite-app graphite-app bot force-pushed the 09-16-feat_data_structures_add_advance_to_end_method_to_sliceiter_trait branch from ffa1557 to 29af0b4 Compare September 20, 2025 12:05
…it (#13947)

Add `advance_to_end` method to `SliceIter` trait. This allows calling `advance_to_end` on any slice iterator.

(this stack of 3 PRs is work I did as part of first attempt to build an ESTree walker, which I abandoned, but the APIs are useful for other tasks in `oxc_ast_tools`).
@graphite-app graphite-app bot force-pushed the 09-16-feat_data_structures_add_advance_to_end_method_to_sliceiter_trait branch from 29af0b4 to f8feed1 Compare September 20, 2025 12:08
@graphite-app graphite-app bot merged commit f8feed1 into main Sep 20, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 09-16-feat_data_structures_add_advance_to_end_method_to_sliceiter_trait branch September 20, 2025 12:14
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants