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

Optimization of tilde expansion #9709

Merged
merged 6 commits into from
Feb 24, 2024
Merged

Conversation

mo8it
Copy link
Contributor

@mo8it mo8it commented Feb 23, 2024

I was reading some code to fix #5706 but then I found that expand_tilde allocates even when it is not necessary. Therefore, I added some 🐄

Please read the commit messages and ask me if anything is not clear.

This is my first contribution, so please tell me if I missed some contribution guide point 😇

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

We generally try to avoid refactors unless the new code is a big improvement. Avoiding the allocation here is nice-to-have but not worth a medium/large change. With some small tweaks we can get the diff to be very small though

helix-stdx/src/path.rs Outdated Show resolved Hide resolved
helix-stdx/tests/path.rs Outdated Show resolved Hide resolved
@kirawi kirawi added A-core Area: Helix core improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 23, 2024
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Thanks!

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 24, 2024
@pascalkuthe pascalkuthe merged commit 6db666f into helix-editor:master Feb 24, 2024
6 checks passed
uek-1 pushed a commit to uek-1/helix that referenced this pull request Feb 24, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
ofzo pushed a commit to ofzo/helix-editor that referenced this pull request Feb 26, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Use next and avoid a redundant prefix strip

* Avoid allocations

Especially when `expand_tilde` is claled on a path
that doesn't contain a tilde.

* Add a test

* Use Into<Cow<…>>

* Put the expand_tilde test at the end of the file

* Remove unused importsw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Helix core improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

:open should support globbing / wildcards
4 participants