Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stdlib] Optimize _StringSliceIter to not have branching in forward iteration #3546

Closed
wants to merge 21 commits into from

Conversation

martinvuyk
Copy link
Contributor

@martinvuyk martinvuyk commented Sep 24, 2024

Optimize _StringSliceIter to not have branching in forward iteration.

This also fixes an error in the iterator's __len__ logic which assumed it would be called only at the beginning of the iteration

Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
@martinvuyk martinvuyk marked this pull request as ready for review October 20, 2024 22:38
@martinvuyk martinvuyk requested a review from a team as a code owner October 20, 2024 22:38
Copy link
Collaborator

@JoeLoser JoeLoser left a comment

Choose a reason for hiding this comment

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

For the part about

This also fixes an error in the iterator's len logic which assumed it would be called only at the beginning of the iteration

Can we add a unit test case that gets fixed as a result of your changes?

Signed-off-by: martinvuyk <[email protected]>
@martinvuyk martinvuyk requested a review from JoeLoser November 4, 2024 20:52
@JoeLoser
Copy link
Collaborator

!sync

@modularbot modularbot added the imported-internally Signals that a given pull request has been imported internally. label Nov 22, 2024
@modularbot
Copy link
Collaborator

✅🟣 This contribution has been merged 🟣✅

Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours.

We use Copybara to merge external contributions, click here to learn more.

@modularbot modularbot added the merged-internally Indicates that this pull request has been merged internally label Dec 2, 2024
modularbot pushed a commit that referenced this pull request Dec 3, 2024
… in forward iteration (#51441)

[External] [stdlib] Optimize `_StringSliceIter` to not have branching in
forward iteration

Optimize `_StringSliceIter` to not have branching in forward iteration.

This also fixes an error in the iterator's `__len__` logic which assumed
it would be called only at the beginning of the iteration

Co-authored-by: martinvuyk <[email protected]>
Closes #3546
MODULAR_ORIG_COMMIT_REV_ID: 0919af33312b082a4bac7d1547a193fba378e56f
@modularbot modularbot added the merged-externally Merged externally in public mojo repo label Dec 3, 2024
@modularbot
Copy link
Collaborator

Landed in 57f4962! Thank you for your contribution 🎉

@modularbot modularbot closed this Dec 3, 2024
@martinvuyk martinvuyk deleted the optimize-stringsliceiter branch December 3, 2024 12:13
modularbot pushed a commit that referenced this pull request Dec 17, 2024
… in forward iteration (#51441)

[External] [stdlib] Optimize `_StringSliceIter` to not have branching in
forward iteration

Optimize `_StringSliceIter` to not have branching in forward iteration.

This also fixes an error in the iterator's `__len__` logic which assumed
it would be called only at the beginning of the iteration

Co-authored-by: martinvuyk <[email protected]>
Closes #3546
MODULAR_ORIG_COMMIT_REV_ID: 0919af33312b082a4bac7d1547a193fba378e56f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported-internally Signals that a given pull request has been imported internally. merged-externally Merged externally in public mojo repo merged-internally Indicates that this pull request has been merged internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants